- Red Hat Enterprise Linux 5, 6, 7
- How to restrict yum to install or upgrade a package to a specific version only?
- How to restrict yum to install or upgrade a package to a fixed specific version and not to a later version than specified.
- How to lock the package to the specific version from update?
- What is
You can restrict yum to install or upgrade a package to a fixed specific version and not to a later version than specified using the versionlock plugin of yum.
To do this, follow:
Install package named
yum-versionlockin RHEL 5).
# yum install yum-plugin-versionlock
/etc/yum/pluginconf.d/versionlock.listwill be created on the system.
To install or lock the version of the
gccpackage, add that package name to the
/etc/yum/pluginconf.d/versionlock.listfile by running:
# yum versionlock gcc-*
(Alternatively, you can edit the filelist,
- The above configuration will not allow to upgrade the
gccpackage to version greater than what was installed at the time the locking was performed.
- Yum will attempt to update all packages, while excluding the packages listed in the versionlock file.
To display the list, use:
# yum versionlock list
To discards the list, use:
# yum versionlock clear
yum-versionlock(1) for a list of all available commands.
- Red Hat Enterprise Linux
- Learn more
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.