Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Context:

We've got multiple custom-added yum repositories (on CentOS 6), and our users regularly install various/arbitrary software via yum to test things.

We have a package that is available on multiple repositories. It's named the exact same thing on two different repositories, call them Y and Z, but the packages are NOT identical. Both repositories are used for other things/installations, but the package in question should only ever be installed from repo Y.

What I've Tried:

When I manually install the package in question, I exclude/include repos to ensure that I'm getting the correct version. However, ordinary users a) forget to do that, and b) sometimes install other packages that depend on the package in question, and it gets installed from the wrong repo as part of the dependency installation process.

Question:

Is there any way to configure yum's defaults to say that "if package X is available from more than one source, prefer/insist on source Y over source Z?"

My goal is not to have to change the normal yum install process that our users currently have; they should still be able to install arbitrary software using the simplest syntax possible. It's just that specific packages (either installed manually or as part of dependency installation) should only be allowed to come from certain repos.

share|improve this question

2 Answers 2

up vote 5 down vote accepted

There is the yum-plugin-priorities package.
That allows you to give priority to configured repositories.
See here: http://wiki.centos.org/PackageManagement/Yum/Priorities#head-6f52124e909c1691eb0c501ba38ae9202b66d6da

Or you can exclude packages in /etc/yum.conf.
http://linux.die.net/man/5/yum.conf:

exclude List of packages to exclude from updates or installs. This should be a space separated list. Shell globs using wildcards (eg. * and ?) are allowed.

This can be set globally or per repository.

share|improve this answer

No, yum has exactly one way of deciding which version of package X to install, which is to pick the latest version it can find (where "latest" has a specific meaning to RPM version comparison).

Really, I wouldn't recommend having different conflicting versions all with the same name, in the way you describe. However, if you're stuck with it, a couple of suggestions:

  • Give an specific version to yum install, e.g. name-ver, name-ver-rel (see man yum)
  • Fix your package dependencies to use something other than the plain package name; either a specific version, or a virtual "Provides", or a specific file present only in the required version, or something else which differentiates the various versions.
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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