SPEC 文件构建了两个 RPM,但依赖关系使得 -Uvh 升级不可能

发布于 2024-11-29 12:31:01 字数 818 浏览 2 评论 0原文

我正在开发一个规范文件(foo.spec),该文件在构建时会产生两个 RPM:foo-1-1.i386.rpm(主程序)和libfoo- 1-1.i386.rpm(所需的库文件)。 foo.spec 文件指出 foo 需要相同版本和发行级别的 libfoo:

Requires: libfoo = %{version}-%{release}

foo-1-1 安装得很好:

rpm -ivh libfoo-1-1.i386.rpm

安装依赖库,然后:

rpm -ivh foo-1-1.i386.rpm

但是升级到更新的版本 (foo-2-1)由于对库的依赖而不起作用:

$ rpm -Uvh libfoo-2-1.i386.rpm
error: Failed dependencies:
       libfoo = 1-1 is needed by (installed) foo-1-1.i386

$ rpm -Uvh foo-2-1.i386.rpm
error: Failed dependencies:
       libfoo = 2-1 is needed by foo-2-1.i386

所以我陷入困境。我希望用户能够执行 rpm -Uvh 来升级 foo 软件包(要求他们忽略依赖项等,这对新手用户要求太高了)。

关于如何解决此问题的任何想法,以便在新版本可用时可以使用 rpm -Uvh 升级软件包的所有部分?

提前致谢。

I'm working on a spec file (foo.spec) that, when built, results in two RPMs: foo-1-1.i386.rpm (the main program) and libfoo-1-1.i386.rpm (the required library files). The foo.spec file states that foo requires libfoo at the same version and release level:

Requires: libfoo = %{version}-%{release}

foo-1-1 installs just fine with:

rpm -ivh libfoo-1-1.i386.rpm

which installs the dependent library, and then:

rpm -ivh foo-1-1.i386.rpm

But upgrading to a newer version (foo-2-1) doesn't work because of the dependency on the libraries:

$ rpm -Uvh libfoo-2-1.i386.rpm
error: Failed dependencies:
       libfoo = 1-1 is needed by (installed) foo-1-1.i386

$ rpm -Uvh foo-2-1.i386.rpm
error: Failed dependencies:
       libfoo = 2-1 is needed by foo-2-1.i386

So I'm stuck. I want users to be able to do rpm -Uvh to upgrade the foo package (requiring them to ignore dependencies, etc. is asking too much of novice users).

Any ideas of how I can work around this so that rpm -Uvh can be used to upgrade all parts of the package when a new release is available?

Thanks in advance.

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

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

发布评论

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

评论(1

与风相奔跑 2024-12-06 12:31:01

rpm 不应该也不允许您单独更新这些 RPM,因为安装第一个 RPM 和第二个 RPM 之间的状态无效。

正如 Hasturkun 指出的那样,您可以在同一个命令中安装它们:

rpm -Uvh libfoo-2-1.i386.rpm foo-1-1.i386.rpm

FWIW,如果您创建一个 yum 存储库并使用它来更新,您会发现更新一个 RPM 会自动拖入另一个 RPM。

rpm shouldn't and doesn't allow you to update these RPMs individually as the the state between installing the first RPM and the second is not valid.

You can, as Hasturkun points out, install both of them in the same command:

rpm -Uvh libfoo-2-1.i386.rpm foo-1-1.i386.rpm

FWIW, if you creaate a yum repo and used that to update you would find that updating one RPM would automatically drag in the other.

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