jump to navigation

Yum Priorities on CentOs November 17, 2010

Posted by Tournas Dimitrios in Linux.
trackback

My previous article demonstrated how to add extra repo’s on your CentOs box . Run the command ls -l /etc/yum.repos.d/  to see what repo’s are already installed on your box . . An obvious question is :  if a package is available on more than one repositories (with different release ) ,  from which repository will the package downloaded or upgraded ?

The Yum Priorities plugin can be used to enforce ordered protection of repositories, by associating priorities to repositories. Visit the Yum Priorities CentOS Wiki for more information.

Install Yum Priorities 

  1. Run the Yum Priorities install command
    yum install yum-priorities

Configure Yum Priorities

  1. Open the Yum Priorities configuration file
    /etc/yum/pluginconf.d/priorities.conf

    1. Ensure the following lines exist
      [main]
      enabled=1
    2. Save and close the file
  2. Open the CentOS base repository configuration file
    /etc/yum.repos.d/CentOS-Base.repo

    1. Add the following text to the end of the Base, Updates, Addons, and Extras repository entries*
      priority=1
    2. Add the following text to the end of the CentOSPlus repository entry*
      priority=2

Of course we can always override the defauld priorities with :

yum – -disablerepo=”*”  – -enablerepo=”repo-name” install  package-name

* A repository entry is specified with the repository name placed between [ and ] (i.e. the base repository entry is specified with [base]).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s