howtouselinux

How to use yum to list All versions of Package

Table of Contents

By default, yum installs the latest version of a package among the all versions available in enabled repositories. Often it is required to install not the latest one, but some specific version or downgrade the already installed package to an older version.

In this post, we will show how to make yum list all available versions of a specified package and how to instruct it to install the particular one.

Show All Versions Of Package

Run the following command to show all versions of a package, available in enabled repositories: $yum list <package_name> –showduplicates

Example: # yum list glibc-locale-source –showduplicates
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.

Last metadata expiration check: 0:31:11 ago on Wed 20 Jul 2022 02:01:41 AM GMT.
Installed Packages
glibc-locale-source.x86_64 2.28-151.el8 @wd_rpm
Available Packages
glibc-locale-source.x86_64 2.28-151.el8 wd_rpm
glibc-locale-source.x86_64 2.28-164.el8_5.3 wd_rpm

Install Specific Version Of Package

To install a specific version of a package, run: $ sudo yum install <package_name><version_info>

Example:yum install glibc-locale-source-2.28-151.el8

Force Yum To Downgrade Package

If we already have the latest version of a package installed, but we need to downgrade it to the particular version that is older, execute: $ sudo yum downgrade <package_name><version_info>