FoxuTech

Yum Command To Downgrade or Rollback Updates on RHEL/CentOS

Yum Command To Downgrade or Rollback Updates

Sometimes the software update won’t work as expected, this may lead to application down or some other incident or events. If its happen we have to have some quick fix, so end user wont feels any more downtime and some other issues. Here will see How can we use yum command to downgrade or rollback package updates on a RHEL (Red Hat)/CentOS Linux server?

YUM Downgrade syntax for CentOS/RHEL v5.4+ users

Basic Syntex:

# yum downgrade package1
# yum downgrade package1 package2
Example
To downgrade httpd, enter:
 # yum downgrade httpd

This will downgrade a package to the previously highest version or you can specify the whole version and release number for the package to downgrade as follows:

# yum downgrade httpd-2.2.15-59.el6.centos.x86_64

You Can get the package details with version using;

# rpm –qa | grep httpd

YUM Downgrade syntax for CentOS/RHEL 6.x/7.x+ users

The syntax is:

# yum history
# yum history undo {NUMBER-HERE}

Examples

For demo, lets install/update httpd:
 # yum install httpd
Now, list yum history:
 # yum history
 # yum history list
 # yum history all

Let us undo (downgrade) ID #11
 # yum history undo 11

Verify httpd package history, enter:
 # yum history list httpd
 

Problems with performing downgrades

There are a number of problems with performing downgrades. I’ll cover a few of them here: (Referred from BaseURL)

Examples: mysql upgrade from 4->5 will convert a db, but going back the other way won’t fly

upgrading a desktop application from one version to the next major version modifies config files in such a way but cannot modify them back.

There is now a downgrade command.

Exit mobile version