RPM `requires` Installation Order

Home » CentOS » RPM `requires` Installation Order
CentOS 2 Comments

Hello All,

I’m a bit of newbie with rpm/yum, seeking the help from rpm/yum experts.

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

When I install RPM A on a ‘CentOS 6.5′ machine with ‘RPM version 4.8.0’, using the command `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.

I have tried `PreReq` tag as well, which has same behaviour as far as I can tell.

Is there any other means to accomplish my requirement?

Thanks, Shyam

2 thoughts on - RPM `requires` Installation Order

  • PreReq now has the same effect as Requires. In earlier versions it did what you want and I don’t know about CentOS 5 but PreReq is equivalent to Requires in later releases.

    For CentOS 6 and 7 you want OrderWithRequires which was introduced in rpm 4.9 and backported to CentOS 6 earlier this year.

  • AFAIK yum performs installs and updates as atomic operations, ie in your case if installing B fails yum will also roll back the install of A. Doesn’t it?