How to downgrade packages on CentOS

Not all program updates go well. There will be occasions when a program update may have lead to an unstable system due to hardware compatibility issues. For this or whatever the reason, if you want your previous version program back, you need to know how to downgrade the applications.

During this article, we are going to cover how to downgrade an already installed package or an application on CentOS. Previously we have shown you how to downgrade a program on Ubuntu click here to check the tutorial.

Downgrading applications and packages on CentOS

There are three methods which will help you in downgrading a package on CentOS:

  1. Downgrade using rpm command.
  2. Downgrade using yum command.
  3. Downgrade using yum history command.

For this tutorial, we will be using the firefox package to perform the downgrade process. It’s highly recommended to be careful while using the below commands.

First Method: Downgrade Using rpm Command

Step 1. Check the currently installed Firefox version.

firefox --version

Firefox version
Firefox version

Also, you can use the next command to get the firefox version.

rpm -qa | grep firefox

Firefox version using rpm command
Firefox version using rpm command

Step 2. Next, you can download the firefox rpm package from your browser, but be careful not to download from untrusted sources.

Step 3. After downloading the rpm package, use the next command to downgrade Firefox.

rpm -Uvh --oldpackage Downloads/firefox-60.5.0-2.el7.centos.x86_64.rpm

Downgrade Firefox Using rpm Command
Downgrade Firefox Using rpm Command

Step 4. Check the current Firefox version after downgrading.

rpm -qa | grep firefox

Check Firefox Version After Downgrading Using rpm Command
Check Firefox Version After Downgrading Using rpm Command

Second Method: Downgrade Using yum Command

Step 1. List all the current firefox packages from the yum cache.

yum --showduplicates list firefox

List available Firefox packages After Downgrading Using rpm Command
List available Firefox packages After Downgrading Using rpm Command

Step 2. Downgrade firefox using yum command.

sudo yum downgrade firefox

Downgrade Firefox Using yum Command
Downgrade Firefox Using yum Command

Now the yum command will first download the old firefox package.

Downloading Firefox Package
Downloading Firefox Package

After downloading the package successfully, you will get an output like the below screenshot:

After Downloading Firefox Package Using yum Command
After Downloading Firefox Package Using yum Command

Step 3. Now you can check the firefox version.

rpm -qa | grep firefox

Check Firefox Version After Downgrading Using yum Command
Check Firefox Version After Downgrading Using yum Command

Third Method: Downgrade Using yum history Command

This method depends on listing the yum command history, which means containing all the yum commands that are used. Then rollback the changes that have been done to a specific command from the history.

So to better understand this method we will need first to update Firefox (In your case you need to downgrade so skip this step and start from step 3).

Step 1. Update the firefox package using the next command.

sudo yum update firefox

Update Firefox
Update Firefox

After the firefox updates successfully the output will look like the below screenshot:

Firefox Updated Successfully
Firefox Updated Successfully

Step 2. Check the firefox version after updating.

rpm -qa | grep firefox

Check Firefox Version After Updating
Check Firefox Version After Updating

Step 3. List all the yum command history alongside with their ID.

sudo yum history

List yum Command History
List yum Command History

As you can see from the previous screenshot that there is an Update action with ID 5, next, we will use the ID of this transaction to get more information about it.

Step 4. Get more information for a specific yum transaction.

sudo yum history info 5

Get More Information For A Specific yum Transaction
Get More Information For A Specific yum Transaction

Step 5. Now in case you need to rollback to ID number 5, then use the following command.

sudo yum history undo 5

Rollback To A Certain yum Transaction
Rollback To A Certain yum Transaction

Step 6. Finally, you can check the current firefox package version.

rpm -qa | grep firefox

Check Firefox Version After Downgrading Using yum history Command
Check Firefox Version After Downgrading Using yum history Command

Congratulations, you just have learned how to downgrade an already installed centos package in many ways, you can choose the best method which suits you well.

Hend Adel
Hi! I'm Hend Adel, a freelancer technical geek with successful experience in Database, Linux and many other IT fields. I help to build solutions to suit business needs and creating streamlined processes. I love Linux and I'm here to share my skills via FOSS Linux! Thanks for reading my article.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

STAY CONNECTED

24,727FansLike
164FollowersFollow

LATEST ARTICLES