Installing Specific Versions with Yum
In some cases, you may need to install a specific version of a package, rather than the latest version. Yum provides several ways to achieve this.
Listing Available Versions
To view the available versions of a package, you can use the following command:
yum list <package_name>
This will display all the versions of the package that are available in the configured repositories.
Installing a Specific Version
To install a specific version of a package, you can use the following command:
yum install <package_name>-<version>
Replace <package_name>
with the name of the package and <version>
with the desired version number.
For example, to install version 2.4.1 of the httpd
package, you would run:
yum install httpd-2.4.1
Pinning a Package Version
If you want to ensure that a package always remains at a specific version, you can use the yum-plugin-versionlock
plugin to "pin" the package version. This will prevent the package from being automatically updated to a newer version.
To install the yum-plugin-versionlock
plugin, run:
yum install yum-plugin-versionlock
Then, to pin a package version, use the following command:
yum versionlock add <package_name>-<version>
To remove the version lock, use:
yum versionlock delete <package_name>-<version>
By using these Yum commands, you can easily install and manage specific versions of packages on your system.