How To Prevent Package Update Using YUM

on February 21 | in Linux | by | with No Comments

In this howto we will discuss how to prevent any package to be update using yum even its update is available. Sometimes we require to stick with current version of any installed rpm package and does not need to update. But whenever you execute yum command, it will search for available update for the current package install. Even if any package which is part of dependencies of installing rpm package will get update using yum.

This can be prevent by using yum plugin yum-versionlock.

1) Install yum-versionlock

yum install yum-versionlock

Above command will install versionlock plugin to work with.

2) Configure yum-versionlock

We have one package installed named gnupg and has update available.

yum update gnupg
Loaded plugins: langpacks, presto, refresh-packagekit, versionlock
Setting up Update Process
Resolving Dependencies
–> Running transaction check
—> Package gnupg.x86_64 0:1.4.11-3.fc15 will be updated
—> Package gnupg.x86_64 0:1.4.12-1.fc16 will be an update
–> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package        Arch            Version                  Repository        Size
================================================================================
Updating:
gnupg          x86_64          1.4.12-1.fc16            updates          1.3 M

Transaction Summary
================================================================================
Upgrade       1 Package

Total download size: 1.3 M
Is this ok [y/N]: N

Now we will configure yum-versionlock to prevent this package to be update next time. All packages name goes into /etc/yum/pluginconf.d/versionlock.list with format you get from rpm -qa

rpm -qa | grep gnupg
gnupg-1.4.11-3.fc15.x86_64

either write the package name as above in the file or redirect the output.

rpm -qa | grep gnupg >> /etc/yum/pluginconf.d/versionlock.list

cat /etc/yum/pluginconf.d/versionlock.list
gnupg-1.4.11-3.fc15.x86_64

Now again try to update the same package.

yum update gnupg
Loaded plugins: langpacks, presto, refresh-packagekit, versionlock
Setting up Update Process
No Packages marked for Update

You can see it exclude this package for update. If you have any question please comment.

pixelstats trackingpixel
Pin It

related posts

Leave a Reply

Your email address will not be published. Required fields are marked *

« »