Product SiteDocumentation Site

5.16.2. Undo? Redo!

One of the most valuable and definitly one of the most useful aspects of the history command is the ability to undo or redo a transaction. Below is an example of its use:
# yum history undo 1
...
Undoing transaction 1, from Fri Nov 27 22:39:59 2009
    Install      0xFFFF-0.3.9-4.fc12.i686
Resolving Dependencies
--> Running transaction check
---> Package 0xFFFF.i686 0:0.3.9-4.fc12 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

==============================================================================
Package            Arch          Version       Repository                Size
==============================================================================
Removing:
 0xFFFF            i686   0.3.9-4.fc12         installed             100 k

Transaction Summary
==============================================================================
Remove          1 Package(s)
Reinstalling    0 Package(s)
Downgrade       0 Paquete(s)

Is this ok [y/N]:y
Downloading Packages:
Running rpm_check_debug
Running transaction check
Running transaction
  Erasing     : 0xFFFF-0.3.9-4.fc12.i686                                                                                                              1/1 

Erased:
  0xFFFF.i686 0:0.3.9-4.fc12                                                                                                                                 
Complete!
The contents of the history must have changed:
# yum history
...	
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     2 | root <root>            | 2009-11-27 23:07 | Erase          |    1
     1 | root <root>            | 2009-11-27 22:39 | Install        |    1
And now the transaction can be done again.
# yum history redo 1
...
Repeating transaction 1, from Fri Nov 27 22:39:59 2009
    Install      0xFFFF-0.3.9-4.fc12.i686
...