Alexey M.
Alexey M.

Reputation: 1

RPM interdependency - how to solve it

Given: 0) CentOS/Oracle Linux (yum package manager)

1) RPM X depends on RPM Z

2) RPM Y depends on RPM Z

3) We have several versions of each package available, they depend from each other's specific version, so when we install X ver. 1.2 it installs Z ver. 1.2

Situation: We have 3 versions of X, Y, Z available in the repo - 1.0, 1.1 and 1.2 Currently installed version is 1.0 (of each X, Y and Z), installing X ver. 1.1. Consequently it brings out Y ver. 1.2. Then, as we have Z ver. 1.0 installed, yum decides to update it as well but finds the most recent version (1.2) and gets it. As a result when trying to upgrade X from 1.0 to 1.1 we get X, Y, Z of versions 1.2

Is there any way to forbid yum installing Z ver. 1.2 in this case without needing to update two packages simultaneously (X and Y to 1.1)?

Upvotes: 0

Views: 285

Answers (2)

msuchy
msuchy

Reputation: 5427

It should work with versions,eg.:

yum install Z-1.1 X-1.1 Y-1.1

If you do not specify version, yum will retrieve the latest.

The other way is to modify packages and either state:

Requires: Z=1.1

or

Conflicts: Z > 1.1

Upvotes: 0

Jeff Johnson
Jeff Johnson

Reputation: 2390

Yum has an "exclude" directive that is typically used to stop kernel upgrades (but will stop other packages from being upgraded).

See https://www.howtogeek.com/50898/how-to-prevent-yum-from-updating-the-kernel/ for an example.

(aside) I've forgotten whether an explicit version can be mentioned in a yum excludes.

Meanwhile, you likely wish to change your dependencies to require an explicit version of package Z.

E.g. change "Requires: Z" to "Requires: Z = 1.1"

Upvotes: 0

Related Questions