Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top


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.


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
up vote 7 down vote accepted

There is the yum-plugin-priorities package.
That allows you to give priority to configured repositories.
See here:

Or you can exclude packages in /etc/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


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.