3

I'm seeking for help from RPM experts.

Suppose I have an RPM package A which depends on package B. RPM A's spec has Requires:B with autoprov and autoreq enabled.

When I install RPM A on a centos 6.5 machine with RPM version 4.8.0, yum install A :

  • rpm installs A first, then it installs B.
  • The installation of B could partially fail. That is, A would installed even if the installation of the dependency, B has failed.

Is this the expected behaviour? (Shouldn't B be installed before A?)

Can the same behaviour be expected across versions (such as el5)?

I was hoping that the dependencies would be installed before the main package is installed. Which would prevent the installation of the main package, If one of the dependencies failed to install.

Is there any other means to accomplish my requirement?

Thanks.

  • Should I be asking this question in unix.stackexchange rather – Shyam Oct 29 '15 at 0:05
3

Requires say that you need this dependency for runtime. E.g if you put Requires in firefox.spec, then you will have this dependency installed when user run /usr/bin/firefox.

If you need it available during rpm scriptlet execution then you need to state in which phase you need it. E.g:

Requires(pre): perl

If you need it in several sections you need to list it several times. E.g:

Requires(pre): perl
Requires(preun): perl

For more information see http://rpm.org/api/4.4.2.2/tsort.html

  • Thanks. My only concern is portability across versions. Is there anything that I should be aware of – Shyam Nov 2 '15 at 5:50
  • I tried this, and the dependent rpm B's installation failed, despite this the installation of A was successful. (I was hoping that the whole transaction would fail) – Shyam Nov 2 '15 at 8:15
  • looks like this url is 404. try this one. rpm5.org/docs/api/tsort.html – JesseM Feb 7 '17 at 22:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.