Tuesday, August 6, 2013

HOW TO SET YUM-PLUGIN-PRIORITY IN CENTOS 6

The yum-plugin-priority associate a priority to the repositories so that packagesfrom repositories with lower priority will not be used to upgrade packages which were initially installed from higher priority repository. The users can also set the priorities to the repositories so that the packages are installed from higher priority repository if present in multiple repository.This plugin help user to update sytem from repositories which help in maintaining the functioning of CentOS.

To enable the priority-plugin the option of plugin should be enabled in /etc/yum.conf file as follows:

# vim /etc/yum.conf
     [main]

     cachedir=/var/cache/yum/$basearch/$releasever

     keepcache=0

     debuglevel=2

     logfile=/var/log/yum.log

     exactarch=1

     obsoletes=1

     gpgcheck=1

     plugins=1

     installonly_limit=5

     distroverpkg=centos-release
  


The priorities plugin is available at two locations:
By default enabled CentOS Extras Repository where yum-plugin-priority can be installed using following command :

  # yum install yum-plugin-priorities
 
yum-utils sources which has README file with instructions to install the plugin in the archieve directory.


Once the package is installed it should also be enabled in the /etc/yum/pluginconf.d/priorities.conf :

  [main]

  enabled = 1




Following the above steps enables the plugin.Now we can add priorities to the repositories by appending following line
  
 priority=N

to the targeted repository,where N is integer ranging from 1 to 99. Repositories with the lowest numerical value have the highest 
priority. It is best practice to give CentOS base and update repositories very high priority.
The default priority for repositories is 99.

0 comments:

Post a Comment