大网数据广告活动
服务器运维问答

Why are some RPM's "not relocatable"?

· 52CE 我爱测

An RPM is relocatable if you can install it like this: rpm -ivh --prefix=/path/to/non/default/dir package-name.rpm Without getting the following error message: error: package package-name is not relocatable This link states: RPM …

问题原文

原帖链接 · Matthew Moisen · CC BY-SA 3.0

An RPM is relocatable if you can install it like this:

rpm -ivh --prefix=/path/to/non/default/dir package-name.rpm

Without getting the following error message:

error: package package-name is not relocatable

This link states:

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.

It however does not explain why a package builder would not want to permit users the freedom to decide where to install the package.

So, why is it a good idea to make a particular package not relocatable?

已采纳解答

原帖链接 · Michael Hampton · CC BY-SA 3.0

In fact, most RPM packages you will find are not relocatable.

The Fedora Packaging Guidelines 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.

These being the upstream packages for RHEL, you are very unlikely to find a relocatable package in an official Fedora, RHEL/CentOS, or EPEL distribution repository.

You might, however, very rarely find third-party RPMs which are relocatable. But there's no good way to install or manage them once they are installed, as dependency managers can't handle them, and there's little point to trying to relocate the package anyway.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2016-04-30)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。