Wednesday, February 29, 2012

How To Lock Installed RPM Package Update

Lets assume you have a RPM Package installed called firefox-3.6.17-1.el5.centos and you don't want to update it even if a newer version is available. This can by done by using YUM plugin called yum-versionlock. This plugin allows you to lock package update. Just you need to add the list of packages that you want to lock their updates with their version and architecture in the lock file /etc/yum/pluginconf.d/versionlock.list. So, whenever you update your system these packages where excluded by the YUM, because yum reads the file before updating the packages. Now enable this great plugin by following simple easy steps below.

How To Lock Installed RPM Package In Linux

1. Install the plugin by using below command.
[root@ravisaive.in ~]# yum install yum-versionlock
2. Once plugin installed, check enabled = 1 appears in /etc/yum/pluginconf.d/versionlock.conf.
[root@ravisaive.in ~]# cat /etc/yum/pluginconf.d/versionlock.conf
[main]
enabled = 1
locklist = /etc/yum/pluginconf.d/versionlock.list
# Uncomment this to lock out "upgrade via. obsoletes" etc. (slower)
# follow_obsoletes = 1
3. Now add the packages you want to lock in /etc/yum/pluginconf.d/versionlock.list. For example firefox-3.6.17-1.el5.centos.
[root@ravisaive.in ~]# cat /etc/yum/pluginconf.d/versionlock.list
firefox-3.6.17-1.el5.centos
4. Once you added your package in lock list. Try to install the same package with YUM.
[root@ravisaive.in ~]# yum install firefox
Loaded plugins: downloadonly, fastestmirror, priorities, versionlock
Loading mirror speeds from cached hostfile
* base: centos.aol.in
* epel: ftp.kddilabs.jp
* extras: centos.aol.in
* rpmforge: fr2.rpmfind.net
* updates: ftp.iitm.ac.in
Reducing CentOS-5 Testing to included packages only
Finished
1380 packages excluded due to repository priority protections
Reading version lock configuration
Setting up Install Process
Nothing to do
5. Check above output in red line, Yum reads lock file before installating them.

Read my earlier article on Rebuild Corrupted RPM Database.

No comments:

Post a Comment