Published March 13, 2018 by

Rollback or Downgrade an update on CentOS/RHEL

Yum is default package manager for RPM-based Linux distributions like CentOS, RHEL and is used to managing packages for the system. We can install, remove or update packages using the yum command.

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 won't feels any more downtime and some other issues.
In this post, we will learn how we can rollback an update using yum history command on CentOS and RHEL.

For example, install a package. We will install httpd

# yum install httpd

We can check if the package has been installed by using the following command:


# httpd -version


Now that we have a package installed, we will need ID for this installation to undo. We can get the ID by using the following command:

# yum history

This will show the list of installations that happened on the system along with their installation ID


Using yum history undo id that we want to rollback.

# yum history undo 4

This will remove the package from the system. 

# yum history


You can then go ahead check again if the package is there or not.

# httpd -version