To work effectively in Linux systems, an RPM Package file must contain files, metadata, and the versions of the package. You can update, uninstall, install, or manage software packages in Red Hat-based distributions like Fedora, RhEL, and CentOS by using YUM (Yellowdog Updater Modified) package manager. However, if you want to use yum to remove a specific version, read this article. Here, I’ll show you 2 easy methods of using the YUM to uninstall a particular version of a package. I’ll also go through how to upgrade and downgrade a package’s version in Red Hat Linux.
- Learning about YUM package manager.
- Learning about the removal process of a specific version of any package.
- Learning about the advanced version of yum package manager (dnf).
- Learning about version upgrading and downgrading in Linux systems.
- Must be a root user to have sudo privileges.
- Must be registered in the Red-hat Linux system.
Process Flow Chart
[Distro Used Throughout the Tutorial: RHEL 9.2]
2 Practical Methods of Removing Specific Versions of a Package with YUM in Linux
Perhaps you want to remove the older version of any package to install a new one, to do this, you need to know how to remove the specific version with yum. Here, I will describe to you 2 quick methods to complete your task efficiently.
Method 01: Removing Specific Version Using YUM
YUM is the most popular package manager that people use to install, remove or upgrade any packages in Red-hat-based Linux. To remove the specific version of any package by using this package manager, stick to the following instructions:
Steps to Follow >
➊ Open the Red-hat terminal.
➋ Find the specific version to remove it by writing this command:
In this image, you can see that there are two versions of the google chrome package. One is the older version which is 107.0.5304.110-1 and the other one is the newer version which is 116.0.5845.96-1. Now you choose which one to remove from the Linux system. In this article, I will show you the older google chrome version removal process.
sudo yum --showduplicates list google-chrome-stable
➌ Run this command to remove the older version of the google chrome package:
Now, type ‘y’ to continue this process.Finally, the google chrome old version has been removed after pressing ‘ENTER’.
sudo yum remove google-chrome-stable-107.0.5304.110-1.x86_64
Method 02: Removing Specific Version Using Next Generation YUM (dnf)
dnf (Dandified YUM) is the most recent version of the YUM package manager. It has evolved into a front-end package manager in the Linux operating system because it performs better and is a great dependency resolver. With this package manager, you can remove the specific version easily. Just follow the next steps:
Steps to Follow >
➊ Open the Red-hat terminal.
➋ Run this code to find the specific version to remove:
You can notice that google chrome version 107.0.5304.110-1 is installed here.
sudo dnf --showduplicates list google-chrome-stable
➌ Write the following command to remove version 107.0.5304.110-1 of the google chrome package:
Type ‘y’ to complete the removal procedure.Afterward, you can check that, this google chrome version has been removed from your Linux system.
sudo dnf remove google-chrome-stable-107.0.5304.110-1
To help you find the appropriate method, I am describing a comparative analysis of the two discussed methods:
I think this table helps you find your right choice. You can take my tips also. Choose method 2 as it has some additional benefits. However, if your system doesn’t support dnf, go for method 1.
Problem with Writing Version Name
Writing the version name correctly is crucial to specify the package to remove. If you write the version name wrongly, it will show no match for the argument.Therefore, the proper syntax of the writing version name should be maintained to avoid this unwanted error.Follow the syntax carefully to overcome the error.
How to Upgrade and Downgrade to a Specific Version Using Yum
Sometimes you need to upgrade the version of the installed packages to avail all the additional features of the latest one. In order to do this, you don’t need to remove the old version of the packages and then again install the latest version. This single command is enough for the work to be done:
The installed google-chrome-stable-107.0.5304.110-1.x86_64 is upgrading to a newer version which is google-chrome-stable-116.0.5845.96-1.x86_64. Now, permit to complete this process by typing ‘y’.Lastly, the new version of google chrome is installed in your system.
sudo yum upgrade google-chrome-stable
Additionally, if you need the previous version of the google chrome package back, install the version by writing this command, it will automatically downgrade the version:
Write ‘y’ to continue this process.Now, you got back the previous version of the google chrome package.
sudo yum install chrome_107_x86_64.rpm
I hope you can remove the specific version of any package in Linux. In this article, I have explained 2 methods for removing a particular version of the google chrome software package. By following the steps, you can remove any package version according to your preferences. In addition, I have covered how to upgrade and downgrade package versions in Linux systems. Carefully follow each step to do your task successfully. Good Luck!
People Also Ask
- How to Uninstall RPM in Linux [2 Simple Cases]
- How to Uninstall a YUM Package [2 User-Friendly Cases]
- How to Force Remove a Package Without Dependencies Using Yum [2 Methods]
- How to Remove and Purge a Package Using apt-get [4 Methods]
- How to Remove Apt-key in Linux [3 Practical Methods]
- How to Remove Package and Dependencies Using dpkg [4 Cases]