微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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.jb51.cc/linux/396039.html

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐