Managing package versions in Linux is an important task of Linux Server Administration. We often apply an update and the application is broken and unusable. In that case, we need to lock the package version so that the update skips the newer version of the package. Generally, this happens when we want to lock the package version to retain the application's usability. The yum-plugin-versionlock plugin allows Linux Administrators to lock the version of a specific package to prevent unwanted updates during the regular system update process.
Following is the step-by-step guide to lock the package version.
- Install yum-plugin-versionlock plugin in the system.
yum install yum-plugin-versionlock - Lock the version of the package. In the example below I have locked the grub Package version, all the packages that start with the name grub will be locked to the current version and will be skipped during updates.
yum versionlock grub2-*
- Use the list command to list all the package's versions locked.
yum versionlock list - Delete a single package from the locked version list.
yum versionlock delete grub2-common-1:2.06-80.el9_4.alma.1.*
yum versionlock list - Delete all packages from the locked version list.
yum versionlock clear
yum versionlock list