How to Remove a Specific Version Using YUM [2 Easy Methods]

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.

Process flow chart to remove a specific version using YUM:

describing two methods of removing specific version using yum

[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.

You can read our Comparative Analysis of Methods to distinguish between the two methods and best pick one for your need.

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:

sudo yum --showduplicates list google-chrome-stable
EXPLANATION
  • sudo: Provides administrative privileges.
  • yum: Manages packages in Red-hat-based Linux.
  • — showduplicates: shows all versions files of a package.
  • list: Lists all the files.
  • google-chrome-stable: Package name.
checking version of google chrome package to remove with yumIn 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.

➌ Run this command to remove the older version of the google chrome package:

sudo yum remove google-chrome-stable-107.0.5304.110-1.x86_64
EXPLANATION
  • remove: Removes packages in Linux.
  • google-chrome-stable-107.0.5304.110-1.x86_64: Package name with the specific version and architecture.
removing the old version of the google chrome package using yumNow, type ‘y’ to continue this process.typing yes to continue the removal processFinally, the google chrome old version has been removed after pressing ‘ENTER’.

NOTE: Before removing any version, you have to ensure that you are removing the installed version of the package. If the package of that version is not installed in your Linux systems, you can not remove that version.

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:

sudo dnf --showduplicates list google-chrome-stable
EXPLANATION
  • dnf: Advanced version of yum package manager, used to manage packages in Red-hat-based Linux.
finding the available version of google chrome packageYou can notice that google chrome version 107.0.5304.110-1 is installed here.

➌ Write the following command to remove version 107.0.5304.110-1 of the google chrome package:

sudo dnf remove google-chrome-stable-107.0.5304.110-1
EXPLANATION
  • google-chrome-stable-107.0.5304.110-1: Package name with a specific version.
removing the old version of the google chrome package using dnfType ‘y’ to complete the removal procedure.giving permission by typing y in that place Afterward, you can check that, this google chrome version has been removed from your Linux system.

Comparative Analysis of Methods to Remove a Specific Version Using YUM

To help you find the appropriate method, I am describing a comparative analysis of the two discussed methods:

Methods Pros Cons
Method 1
  • Most popular in the Linux community.
  • Greater stability.
  • Reliable.
  • Show slower performance.
  • Doesn’t support parallel downloading.
  • Limited features.
Method 2
  • Performs faster than any package manager.
  • Supports parallel downloading of multiple packages.
  • Handles errors smartly.
  • Not supported by the old version distributions of Linux.
  • Less stable.
  • Occupies more storage.

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.shows error as version name is not written correctly Therefore, the proper syntax of the writing version name should be maintained to avoid this unwanted error.the proper syntax of writing package name with specific versionFollow 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:

sudo yum upgrade google-chrome-stable
EXPLANATION
  • upgrade: Upgrades an older version package to a newer version.
upgrading the google chrome old version to a new one with yumThe 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’.typing y to give permission to start downloading the new version to be upgradedLastly, the new version of google chrome is installed in your system.

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:

sudo yum install chrome_107_x86_64.rpm
EXPLANATION
  • chrome_107_x86_64.rpm: Google Chrome old version rpm package.
downgrading the new version of the google chrome to a old version with yum commandWrite ‘y’ to continue this process.typing y to complete the downgrading processNow, you got back the previous version of the google chrome package.

Conclusion

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 install specific version via yum?
To install a specific version of the rpm package in Red-hat based Linux, use the command ‘sudo yum install package_name-version’. You must specify the package name and the version correctly in this case.
How to remove a single package in yum?
You can run this command as a root user to remove a specific package, as well as the package dependencies: ‘sudo yum remove <package name>’ or ‘sudo dnf remove <package name>’.
What does yum erase do?
‘yum erase’ removes a requested package installed in your Linux system. Actually, it does a similar task as the ‘yum remove’.
How to remove a particular package using yum?
To remove a particular package using yum package manager, you can use sudo yum remove <package_name>.

Related Articles


<< Go Back to Uninstall Packages in Linux | Package Management in Linux | Learn Linux Basics

5/5 - (6 votes)
LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now
Mitu Akter Mou

Hello, This is Mitu Akter Mou, currently working as a Linux Content Developer Executive at SOFTEKO for the Linuxsimply project. I hold a bachelor's degree in Biomedical Engineering from Khulna University of Engineering & Technology (KUET). Experiencing new stuff and gathering insights from them seems very happening to me. My goal here is to simplify the life of Linux users by making creative articles, blogs, and video content for all of them. Read Full Bio

Leave a Comment