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.

2 Answers 2


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.

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.


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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .