YUM History (list, info, summary, repeat, redo, undo, new)

terminal-logo-smallYum (Yellowdog Update Modified) is RPM Packet Management system for Fedora, CentOS, Red Hat, OpenSuse etc. Yum history (list, info, summary, repeat, redo, undo, new) commands is added on 3.2.25 version. So this works every Linux Distros, which uses yum 3.2.25 or newer. Yum history command is a really useful in situations where the need to example rollback latest yum activity or undelete some deletes or just see what is updated lately.

Yum history and Yum history list

yum history lists all latest yum operations and yum history list list all operations or just selected package operations

Listing all operations

[root ~]> yum history
### OR ###
[root ~]> yum history list
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    45 | System <unset>         | 2010-01-18 09:57 | I, U           |   21
    44 | User <username>        | 2010-01-14 15:31 | Install        |    1
    43 | System <unset>         | 2010-01-14 08:13 | Update         |   19
    42 | System <unset>         | 2010-01-13 10:39 | I, U           |   40
    41 | System <unset>         | 2010-01-11 07:59 | Update         |   16
    40 | System <unset>         | 2010-01-08 07:58 | Update         |   38
    39 | System <unset>         | 2010-01-07 08:39 | I, O, U        |   39
    38 | System <unset>         | 2010-01-05 08:23 | O, U           |   18
    37 | User <username>        | 2010-01-04 15:43 | Install        |    1
    36 | System <unset>         | 2010-01-04 07:56 | Update         |   66
    35 | User <username>        | 2009-12-30 10:07 | Install        |    2
    34 | User <username>        | 2009-12-30 10:01 | Update         |   15
    33 | User <username>        | 2009-12-30 08:14 | Install        |   13
    32 | System <unset>         | 2009-12-29 07:52 | I, U           |   26
    31 | System <unset>         | 2009-12-28 08:31 | E, I, U        |   66
    30 | System <unset>         | 2009-12-23 12:11 | Update         |    7
    29 | System <unset>         | 2009-12-22 13:59 | Update         |   36
    28 | User <username>        | 2009-12-21 13:21 | Install        |    1
    27 | System <unset>         | 2009-12-18 14:59 | Update         |   56
    26 | User <username>        | 2009-12-18 08:46 | Install        |    1
history list

Listing Arora browser operations

[root ~]> yum history list arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     2 | User <username>        | 2010-01-19 15:10 | Erase          |    1
history list

Yum history info

Show full information by history ID.

Remove Arora browser

[root ~]> yum remove arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Setting up Remove Process
[...]
=================================================================================================================================================================================
 Package                                Arch                                  Version                                           Repository                                  Size
=================================================================================================================================================================================
Removing:
 arora                                  i686                                  0.10.2-2.fc12                                     installed                                  3.7 M
 
Transaction Summary
=================================================================================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)
 
Is this ok [y/N]: y
[...]
Running Transaction
  Erasing        : arora-0.10.2-2.fc12.i686                                                                                                                                  1/1 
 
Removed:
  arora.i686 0:0.10.2-2.fc12                                                                                                                                                     
 
Complete!

Yum history list

[root ~]> yum history list
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     2 | User <username>        | 2010-01-19 15:10 | Erase          |    1
     1 | User <username>        | 2010-01-19 14:55 | Update         |    3
history list

Show history info for ID 2

[root ~]> yum history info 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Transaction ID : 2
Begin time     : Tue Jan 19 15:10:13 2010
Begin rpmdb    : 2431:fe4c2c846fd45c9125fb8ab27542a27b22e0d3df
End time       :            15:10:27 2010 (14 seconds)
End rpmdb      : 2430:2eeb12b0b0f2ef3fcb31b4447b439e76e92e3866
User           : User <username>
Return-Code    : Success
Transaction performed with:
    Installed    rpm-4.7.2-1.fc12.i686
    Installed    yum-3.2.25-1.fc12.noarch
    Installed    yum-plugin-fastestmirror-1.1.24-2.fc12.noarch
Packages Altered:
    Erase        arora-0.10.2-2.fc12.i686
history info

Yum history summary

Shows summary of lates operations.

[root ~]> yum history summary
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Login user                 | Time                | Action(s)        | Altered 
-------------------------------------------------------------------------------
User <username>            | Last day            | E, U             |        4
history summary

Yum history repeat

yum history repeat command repeats old operation by history ID.

[root ~]> yum history repeat 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirror.cogentco.com
 * livna: rpm.livna.org
[...]
Repeating transaction 2, from Tue Jan 19 15:10:13 2010
    Erase        arora-0.10.2-2.fc12.i686
No package matched to remove
history repeat

Yum history undo

yum history undo simply undo operations by history ID.

Undo Arora browser erase

[root ~]> yum history undo 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
[...]
Undoing transaction 2, from Tue Jan 19 15:10:13 2010
    Erase        arora-0.10.2-2.fc12.i686
Resolving Dependencies
--> Running transaction check
---> Package arora.i686 0:0.10.2-2.fc12 set to be updated
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=================================================================================================================================================================================
 Package                                 Arch                                   Version                                          Repository                                 Size
=================================================================================================================================================================================
Installing:
 arora                                   i686                                   0.10.2-2.fc12                                    updates                                   1.1 M
 
Transaction Summary
=================================================================================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)
 
Total download size: 1.1 M
Is this ok [y/N]: y
Downloading Packages:
arora-0.10.2-2.fc12.i686.rpm                                                                                                                              | 1.1 MB     00:00     
[...]
Running Transaction
  Installing     : arora-0.10.2-2.fc12.i686                                                                                                                                  1/1 
 
Installed:
  arora.i686 0:0.10.2-2.fc12                                                                                                                                                     
 
Complete!

History list after undo

[root ~]> yum history list arora
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     3 | User <username>        | 2010-01-19 15:35 | Install        |    1
     2 | User <username>        | 2010-01-19 15:10 | Erase          |    1
history list

Yum history redo

yum history redo simply redos operation from yum history by ID.

[root ~]> yum history redo 2
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
[...]
Repeating transaction 2, from Tue Jan 19 15:10:13 2010
    Erase        arora-0.10.2-2.fc12.i686
Resolving Dependencies
--> Running transaction check
---> Package arora.i686 0:0.10.2-2.fc12 set to be erased
--> Finished Dependency Resolution
 
Dependencies Resolved
 
=================================================================================================================================================================================
 Package                                Arch                                  Version                                           Repository                                  Size
=================================================================================================================================================================================
Removing:
 arora                                  i686                                  0.10.2-2.fc12                                     installed                                  3.7 M
 
Transaction Summary
=================================================================================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)
 
Is this ok [y/N]: y
[...]
Running Transaction
  Erasing        : arora-0.10.2-2.fc12.i686                                                                                                                                  1/1 
 
Removed:
  arora.i686 0:0.10.2-2.fc12                                                                                                                                                     
 
Complete!

Yum history new

yum history new command delete/clear old history listing.

[root ~]> yum history new
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
history new
 
[root ~]> yum history
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
history list
Follow If Not True Then False Updates!

6 Comments

  1. Hi,

    Do you know how i can upgrade to the latest version of yum on a Centos 5 box?

    • Hi Ola,

      Yum’s updating manually can be little problematic, because it might need other dependency packages/versions, which not even exist directly on CentOS 5 repositories.

      But if you want to try…YUM official source RPM files found here.

  2. This helped me reinstall about 170 application I had to remove in order to get around a dependency hell. With this knowledge I like yum even more.
    Thanks again

  3. do you mean “yum update yum” ?

    • Hi nightfighter,

      I not sure what you mean, but on CentOS 5 (5.8) latest yum version is 3.2.22, so yum history won’t work, even if you update yum using yum.

  4. Thanks for posting this. It helped me undo a desktop crashing yum move.

Leave a Comment

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Trackbacks/Pingbacks

  1. Fedora 12: yum History (list, info, summary, repeat, redo, undo … | Just linux! - [...] Here is the original: Fedora 12: yum History (list, info, summary, repeat, redo, undo … [...]