redhat – 为什么有些RPM“无法重定位”?

前端之家收集整理的这篇文章主要介绍了redhat – 为什么有些RPM“无法重定位”?前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
如果您可以像这样安装RPM,则可以重新定位RPM:
rpm -ivh --prefix=/path/to/non/default/dir package-name.rpm

没有收到以下错误消息:

error: package package-name is not relocatable

这个link表示:

RPM has the ability to give users some latitude in deciding where packages are to be installed on their systems. However,package builders must first design their packages to give users this freedom. In other words,an RPM package that can be installed into a different directory is said to be relocatable. Please note that not all RPM packages can be installed into another directory.

然而,它并没有解释为什么包构建器不希望允许用户自由决定安装包的位置.

那么,为什么让一个特定的包不可重定位是个好主意呢?

解决方法

事实上,您将找到的大多数RPM软件包都不可重定位.

Fedora包装指南have this to say

The use of RPM’s facility for generating relocatable packages is strongly discouraged. It is difficult to make work properly,impossible to use from the installer or from yum,and not generally necessary if other packaging guidelines are followed. However,in the unlikely event that you have a good reason to make a package relocatable,you MUST state this intent and reasoning in the request for package review.

这些是RHEL的上游软件包,您不太可能在官方Fedora,RHEL / CentOS或EPEL分发存储库中找到可重定位的软件包.

但是,您可能很少发现可重定位的第三方RPM.但是一旦安装它们就没有好的方法来安装或管理它们,因为依赖管理器无法处理它们,并且无论如何都试图重新定位包没有什么意义.

原文链接:https://www.f2er.com/linux/396039.html

猜你在找的Linux相关文章