How to Install a Specific Version of RPM Package Using YUM?

YUM is a package manager used to install, remove, and update RPM packages on a CentOS system. It can also automatically resolve dependencies, making it easier to manage the software on the system. These packages contain the software files as well as metadata related to the package, such as dependencies and version numbers.

This article will explain the step-by-step instructions for installing

the specific version of the RPM package using YUM. Install the specific version of an RPM package Forcefully install a specific version of the package Update a package to a specific version Downgrade a specific version of an RPM package Remove a specific version of an RPM package How to install

  • a
  • specific version of the RPM

package using YUM?

The steps here show the installation

of a specific version of the RPM packages.

Step 1: Find

the specific version of the package

Before installing a specific version of the rpm package, it is recommended to check the available packages. For this, the “yum” command is used with the “grep” specifying the package name as

“zlib”:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-578.png” alt=”” />

The output shows all available packages associated with “zlib“. We will install the “zlib-devel” package with “x86_64” architecture.

Step 2: Install

the specific version of an RPM package

To install a specific RPM package, use the YUM package manager on a CentOS system. The basic syntax of the installation of the specific package is mentioned below

:

Syntax

:

In our case, install the package “zlib-devel” that has the architecture “x86_64” in the following command:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-576.png”

alt=”” />

The output shows that the “zlib-devel” package of version “1.2.7-20.el7_9” has been installed on the system

. How to forcibly install a specific version of the

RPM package? Users can forcibly install a specific version of

the

package and its dependencies using the “skip-broken” utility. For example, specify

the specific package “java-1.8.0-openjdk.x86_64” for installation:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-574.png” alt=””

/>

The output shows that the package “java-1.8.0-openjdk.x86_64” has been installed on the system.

How to update a specific version of the RPM package?

To update a package to a specific version, use the “update” command in the following command:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-573.png” alt=”” />

The output shows that the specific package “python3-3.6.8-18.el7.x86_64” has been updated.

How to downgrade a specific version of the

RPM package? To downgrade a specific version of

the package

, use the

downgrade” command specifying the package name. In our case, specify the package name

“java-1.8.0-openjdk.x86_64” to downgrade using the following command:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-572.png” alt=”” />

The output shows that “java-1.8.0-openjdk.x86_64” has been successfully downgraded.

How to remove a specific version of RPM packages using YUM?

To remove the specific version of RPM packages using YUM, specify the package name. For example, run

the package “java-1.8.0-openjdk.x86_64” with the “remove” utility as follows:

<img src

=”https://itslinuxfoss.com/wp-content/uploads/2023/02/image-571.png” alt=”” />

The output shows that the package “java-1.8.0-openjdk.x86_64” has been removed from the system.

Conclusion

On CentOS, you can follow the command “yum install <package-name>-<version>” to install a specific version of the RPM package. Users must specify the “package name” and “version” for this. This post briefly explained installing a specific version of the RPM package using YUM along with upgrading, downgrading, and removing.