The cart is empty

Managing package versions and their updates is a crucial aspect of Linux server administration. On CentOS 7 systems, one of the most effective tools for this purpose is the yum-plugin-versionlock plugin. This plugin allows administrators to lock the version of a specific package (or group of packages) to prevent their unwanted updates during the regular system update process. This article provides an overview of how to install and use this plugin for efficient package version management on CentOS 7.

Installation of yum-plugin-versionlock

Before using the versionlock plugin, it needs to be installed. The plugin is not present in the default installation of CentOS 7, so it needs to be installed using the yum tool. The following command installs the plugin:

sudo yum install yum-plugin-versionlock

Once the installation is complete, the plugin is ready for use.

Configuration and Usage of versionlock

The main function of the versionlock plugin is the ability to "lock" a package version, thereby preventing its update using the yum update command. Locking a package version is done by adding an entry to the versionlock list. This list is typically located in the /etc/yum/pluginconf.d/versionlock.list file.

Adding a Package to the versionlock List

To add a package to the versionlock list, use the following command:

sudo yum versionlock add package_name

Replace package_name with the actual name of the package you want to lock. This command adds a record of the package to /etc/yum/pluginconf.d/versionlock.list, preventing its update.

Removing a Package from the versionlock List

If you wish to unlock a package and allow its update, use the command:

sudo yum versionlock delete package_name

Listing Locked Packages

To display a list of all packages currently locked, you can use the command:

sudo yum versionlock list

Using the yum-plugin-versionlock on CentOS 7 is an excellent way to manage software package versions and prevent unwanted updates that could disrupt system or application stability. By properly utilizing this tool, administrators can ensure that system updates proceed smoothly and without any unpleasant surprises. It's an essential tool for anyone seeking better control over package versions on their Linux servers.