How to use yum history to roll back an update in Red Hat Enterprise Linux 6 , 7?
Environment
- Red Hat Enterprise Linux 6 , 7
- yum
Issue
- How to roll back an update using yum in Red Hat Enterprise Linux-6, 7?
- How to use yum history?
- Information on best practice to enable easy backout of yum patching
Resolution
Note: Downgrading a system to minor version (ex: RHEL6.1 to RHEL6.0) is not recommended as this might leave the system in broken state where libgcc and other libraries won't rollback as expected. Use the history option for small update rollbacks.
Note: Rollback of selinux, selinux-policy-*, kernel, glibc (dependencies of glibc such as gcc) packages to older version is not supported.
If you decide to proceed with rollback, rather then reinstall, here are the instructions:
- Red Hat Enterprise Linux 6 includes the yum history module which helps to rollback any updates done with the yum command. With this command, you can choose an update yum issued and remove those selected packages. The following is an example while installing the
screen
package:
[root@localhost ~]# yum install screen
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
rhel-6-server-rpms | 2.4 kB 00:00
rhel-ha-for-rhel-6-server-rpms | 2.4 kB 00:00
rhel-lb-for-rhel-6-server-rpms | 2.0 kB 00:00
rhel-rs-for-rhel-6-server-rpms | 2.4 kB 00:00
rhel-scalefs-for-rhel-6-server-rpms | 951 B 00:00
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package screen.i686 0:4.0.3-16.el6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================================
Installing:
screen i686 4.0.3-16.el6 rhel-6-server-rpms 484 k
Transaction Summary
======================================================================================================================================================================
Install 1 Package(s)
Total download size: 484 k
Installed size: 484 k
Is this ok [y/N]: y
Downloading Packages:
screen-4.0.3-16.el6.i686.rpm | 484 kB 00:08
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : screen-4.0.3-16.el6.i686 1/1
rhel-6-server-rpms/productid | 1.7 kB 00:00
rhel-ha-for-rhel-6-server-rpms/productid | 1.7 kB 00:00
rhel-lb-for-rhel-6-server-rpms/productid | 1.7 kB 00:00
rhel-rs-for-rhel-6-server-rpms/productid | 1.7 kB 00:00
duration: 319(ms)
Installed products updated.
Installed:
screen.i686 0:4.0.3-16.el6
Complete!
[root@localhost ~]# yum history
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
8 | root <root> | 2011-10-03 14:40 | Install | 1
7 | root <root> | 2011-09-21 04:24 | Install | 1 ##
6 | root <root> | 2011-09-21 04:23 | Install | 1 ##
5 | root <root> | 2011-09-16 13:35 | Install | 1
4 | root <root> | 2011-09-16 13:33 | Erase | 1
3 | root <root> | 2011-09-14 14:36 | Install | 1
2 | root <root> | 2011-09-12 15:48 | I, U | 80
1 | System <unset> | 2011-09-12 14:57 | Install | 1025
[root@localhost ~]# yum history undo 8
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
rhel-6-server-rpms | 2.4 kB 00:00
rhel-ha-for-rhel-6-server-rpms | 2.4 kB 00:00
rhel-lb-for-rhel-6-server-rpms | 2.0 kB 00:00
rhel-rs-for-rhel-6-server-rpms | 2.4 kB 00:00
rhel-scalefs-for-rhel-6-server-rpms | 951 B 00:00
Undoing transaction 8, from Mon Oct 3 14:40:01 2011
Install screen-4.0.3-16.el6.i686
Resolving Dependencies
--> Running transaction check
---> Package screen.i686 0:4.0.3-16.el6 will be erased
--> Finished Dependency Resolution
Dependencies Resolved
======================================================================================================================================================================
Package Arch Version Repository Size
======================================================================================================================================================================
Removing:
screen i686 4.0.3-16.el6 @rhel-6-server-rpms 783 k
Transaction Summary
======================================================================================================================================================================
Remove 1 Package(s)
Installed size: 783 k
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Erasing : screen-4.0.3-16.el6.i686 1/1
duration: 320(ms)
Installed products updated.
Removed:
screen.i686 0:4.0.3-16.el6
Complete!
Source: https://access.redhat.com/solutions/64069
No comments:
Post a Comment