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.
然而,它并没有解释为什么包构建器不希望允许用户自由决定安装包的位置.
那么,为什么让一个特定的包不可重定位是个好主意呢?
解决方法
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.但是一旦安装它们就没有好的方法来安装或管理它们,因为依赖管理器无法处理它们,并且无论如何都试图重新定位包没有什么意义.