This Blog is to share our knowledge and expertise on Linux System Administration and VMware Administration

Saturday, October 14, 2017

How to roll back an update in Linux Server?


Roll back packages by using yum in linux


Downgrading a system to minor version (ex: RHEL6.8 to RHEL6.7) 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.

Roll back of some package to older version is not supported & it makes server crash or installed application will not work properly.

We can use yum history command to rollback.

Please find the below example.

[root@nsklinux ~]# yum install dovecot

Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.vbctv.in
 * extras: centos-hn.viettelidc.com.vn
 * updates: centos-hn.viettelidc.com.vn
Resolving Dependencies
--> Running transaction check
---> Package dovecot.x86_64 1:2.0.9-22.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved


===============================================================

 Package                         Arch       Version           Repository          Size
===============================================================
Installing:                                                             
 dovecot                         x86_64     1:2.0.9-22.el6    base               1.9 M
                                                                        
Transaction Summary                                                     
===============================================================
Install       1 Package(s)

Total download size: 1.9 M

Installed size: 5.7 M
Is this ok [y/N]: y
Downloading Packages:
dovecot-2.0.9-22.el6.x86_64.rpm              | 1.9 MB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 1:dovecot-2.0.9-22.el6.x86_64       1/1
  Verifying  : 1:dovecot-2.0.9-22.el6.x86_64       1/1

Installed:

  dovecot.x86_64 1:2.0.9-22.el6

Complete!

[root@nsklinux ~]#
[root@nsklinux ~]#


[root@nsklinux ~]# yum history

Loaded plugins: fastestmirror, security
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     5 | root <root>              | 2017-10-14 08:01 | Install        |    1
     4 | root <root>              | 2017-10-14 07:52 | I, O, U       |  506 EE
     3 | root <root>              | 2017-10-14 07:27 | Update      |    2
     2 | root <root>              | 2017-10-14 07:17 | I, O            |     3
     1 | System <unset>      | 2017-10-14 07:07 | Install        |  610
history list


[root@nsklinux ~]# yum history undo 5

Loaded plugins: fastestmirror, security
Undoing transaction 5, from Sat Oct 14 08:01:55 2017
    Install dovecot-1:2.0.9-22.el6.x86_64 @base
Resolving Dependencies
--> Running transaction check
---> Package dovecot.x86_64 1:2.0.9-22.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved


=============================================================

 Package                       Arch         Version           Repository    Size
=============================================================
Removing:                                                               
 dovecot                       x86_64       1:2.0.9-22.el6    @base        5.7 M
                                                                        
Transaction Summary                                                     
=============================================================
Remove        1 Package(s)

Installed size: 5.7 M

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : 1:dovecot-2.0.9-22.el6.x86_64      1/1
  Verifying  : 1:dovecot-2.0.9-22.el6.x86_64     1/1

Removed:

  dovecot.x86_64 1:2.0.9-22.el6

Complete!

[root@nsklinux ~]# rpm -qa | grep -i dovecot
[root@nsklinux ~]#

No comments:

Post a Comment