Product SiteDocumentation Site

4.3.2. Set Repository Priorities

This is optional, and we recommend it for advanced users.
By default, yum installs the package with the highest version number, regardless of the repository. You can change yum to install packages from a specific repository, even when another repository has a higher version number.


Think about your repository priorities carefully. You may accidentally cause yum to not install security updates and accidentally leave your computer vulnerable to attack.
If you want to prevent one or a few packages from being updated, see Section 4.3.3, “Prevent a Package from Being Updated” for more appropriate instructions.
  1. Install the yum-plugin-priorities package.
  2. Use a text editor or the cat or less command to verify that /etc/yum/pluginconf.d/priorities.conf exists, and contains the following text: enabled = 1. If you want to stop using the plugin, you can edit this file so it contains enabled = 0. This does not affect the priorities set in the repository configuration files.
  3. You can set priorities for some or all repositories. To add a priority to a repository, edit its respective file in the /etc/yum.repos.d/* directory, adding a line like: priority = N where N is a number between 1 and 99, inclusive. A priority of 1 is the highest setting, and 99 is the lowest. You will need to set priorities of at least two repositories before this becomes useful.