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.但是一旦安装它们就没有好的方法来安装或管理它们,因为依赖管理器无法处理它们,并且无论如何都试图重新定位包没有什么意义.

相关文章

1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...
如何抑制stable_secret读取关键的“net.ipv6.conf.all.stabl...
1 删除0字节文件 find -type f -size 0 -exec rm -rf {} ...
## 步骤 1:安装必要的软件包 首先,需要确保系统已安装 `dh...