开发者

SPEC file builds two RPMs, but dependency makes -Uvh upgrade impossible

开发者 https://www.devze.com 2023-03-28 00:05 出处:网络
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 fo

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 leve开发者_JS百科l:

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消