并排 RPM 版本

发布于 2024-11-01 19:31:45 字数 221 浏览 0 评论 0原文

设计 RPM 以便可以通过 YUM/RPM 并排安装多个版本而不会互相干扰,“正确”的方法是什么(如果有的话)?对于库来说,正确的答案似乎与 sonames 有关,尽管我找不到任何关于 sonames、符号链接和 RPM 如何相互作用的好信息。我不知道应该如何命名/放置可执行文件和普通文件以便并排放置。就可执行文件而言,正确的行为似乎是将较新的版本放在 PATH 上,但如果卸载了较新的 RPM,则将旧版本放在 PATH 上。

What is the "right" way, if any, to design RPMs so that multiple versions can be installed via YUM/RPM side by side without stomping on each other? For libraries, the right answer seems to be related to sonames, although I can't find any good information about how sonames, symlinks, and RPMs interact with each other. I have no idea how executables and plain files ought to be named/placed in order to be placed side by side. It seems the right behaviour as far as executables go would be to have the newer version on the PATH, but have the older version be on the PATH if the newer RPM is uninstalled.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清欢 2024-11-08 19:31:45

本质上,您需要确保版本不冲突:

  • 要求/冲突部分不得有冲突的要求
  • 每个文件名必须仅存在于一个版本中 - 除非它们是相同的
  • Scriptlet (%post 等) 如果您有它们,则必须合作

请注意,您将使用 yum 安装多个版本时会遇到麻烦,因为 yum 被设计为一次安装一个版本 - 内核除外。如果您使用 yum 安装/更新软件包,所有旧版本都将被删除。因此,您需要对每个版本使用 rpm -i。

对于路径中包含更新的二进制文件,不可能正确执行此操作。您要么需要执行类似 python 的操作,其中用户必须在命令行上指定 python 或 python3,要么您必须在所需二进制文件的路径上创建符号链接。这必须在 scriptlet 中完成,管理它是一个相当大的挑战。这也意味着符号链接不属于任何包。

Essentially you need to ensure that the versions do not conflict:

  • Requires/Conflicts sections must not have conflicting requirements
  • Each filename must only exist in one version - unless they are identical
  • Scriptlets (%post ect) if you have them must cooperate

Note that you will have trouble installing multiple versions with yum as yum is designed to have one version installed at a time - with the exception of the kernel. If you install/update a package with yum all old versions will be removed. Consequently you'll need to use rpm -i for each version.

With regard to have more recent binaries in the path it is not possible to do it properly. You either need to do something like python where the user has to specify python or python3 on the command line or you have to do a dance with creating symlinks on the path to the binary that you want. This would have to be done in the scriptlets and managing it is quite a challenge. It also means that the symlink wouldn't be owned by any package.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文