SPEC 文件构建了两个 RPM,但依赖关系使得 -Uvh 升级不可能
我正在开发一个规范文件(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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
rpm 不应该也不允许您单独更新这些 RPM,因为安装第一个 RPM 和第二个 RPM 之间的状态无效。
正如 Hasturkun 指出的那样,您可以在同一个命令中安装它们:
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:
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.