Saturday, December 19, 2009

Fedora 12 Yum New Feature 'history'

With Fedora 12 which was recently released and with F12 new version of Yum package manager also released. One of the new feature that new version of Yum bring is history.

The history command allows the user to view what has happened in past transactions. You can use info/list/summary to view what happened, undo/redo to act on that information and new to start a new his-tory file.

The info/list/summary commands take either a transactions id or a package (with wildcards, as in Specifying package names), all three  can also be passed no arguments. list can be passed the keyword "all" to list all the transactions.  undo/redo just take a transaction id.


Here are few examples:

$ sudo yum history
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    23 | Askar Ali Khan | 2009-12-19 20:29 | Update         |   35
    22 | Askar Ali Khan | 2009-12-19 20:22 | Install        |    1
    21 | Askar Ali Khan | 2009-12-19 19:57 | Erase          |    1
    20 | System          | 2009-12-16 20:16 | Update         |   20
    19 | System          | 2009-12-13 10:03 | E, I, U        |   51
    18 | System          | 2009-12-09 19:19 | Install        |    1
    17 | System          | 2009-12-09 19:12 | Update         |   14
    16 | System          | 2009-12-07 20:51 | I, U           |   33
    15 | System          | 2009-12-03 17:20 | Update         |   10
    14 | Askar Ali Khan | 2009-12-02 17:57 | I, O, U        |   56
    13 | System          | 2009-11-30 20:37 | Update         |   46
    12 | Askar Ali Khan | 2009-11-30 20:29 | Install        |    1
    11 | Askar Ali Khan | 2009-11-25 20:53 | Update         |   19  <
    10 | Askar Ali Khan | 2009-11-22 09:55 | Erase          |    1 >
     9 | Askar Ali Khan | 2009-11-22 09:55 | Erase          |    3
     8 | Askar Ali Khan | 2009-11-22 09:54 | Install        |    1
     7 | Askar Ali Khan | 2009-11-22 09:53 | Install        |    1
     6 | Askar Ali Khan | 2009-11-22 09:52 | Erase          |    1
     5 | Askar Ali Khan | 2009-11-22 09:50 | Erase          |    3
     4 | System          | 2009-11-20 19:12 | I, U           |   38


To list packages of a transaction, use option 'info' followed by transactions id

$sudo yum history info 15
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Transaction ID : 15
Begin time     : Thu Dec  3 17:20:15 2009
Begin rpmdb    : 1328:10c8f90e66eb2c26aa380265fb4b5b11e56aae7a
End time       :            17:20:53 2009 (38 seconds)
End rpmdb      : 1328:465b91d25241fa9452547719e554f9fb8ec9ac73
User           : System
Return-Code    : Success
Transaction performed with:
    Installed    rpm-4.7.1-6.fc12.i686
    Installed    yum-3.2.25-1.fc12.noarch
    Installed    yum-metadata-parser-1.1.2-14.fc12.i686
    Installed    yum-plugin-fastestmirror-1.1.24-2.fc12.noarch
Packages Altered:
    Updated      fontpackages-filesystem-1.35-1.fc12.noarch
    Update                               1.41-1.fc12.noarch
    Updated      gnome-python2-applet-2.28.0-1.fc12.i686
    Update                            2.28.0-2.fc12.i686
    Updated      gnome-python2-desktop-2.28.0-1.fc12.i686
    Update                             2.28.0-2.fc12.i686
    Updated      gnome-python2-gnomekeyring-2.28.0-1.fc12.i686
    Update                                  2.28.0-2.fc12.i686
    Updated      gnome-python2-libwnck-2.28.0-1.fc12.i686
    Update                             2.28.0-2.fc12.i686
    Updated      libsndfile-1.0.20-2.fc12.i686
    Update                  1.0.20-3.fc12.i686
    Updated      liveusb-creator-3.8.6-1.fc12.noarch
    Update                       3.8.7-1.fc12.noarch
    Updated      mdadm-3.0.3-1.fc12.i686
    Update             3.0.3-2.fc12.i686
    Updated      wget-1.11.4-5.fc12.i686
    Update            1.12-2.fc12.i686
    Updated      xorg-x11-drv-dummy-0.3.2-3.fc12.i686
    Update                          0.3.3-1.fc12.i686
history info


Now to undo a transaction, use option 'undo' with the transaction id:

$ sudo yum history undo 22
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
updates/metalink                                                                                                                      | 7.7 kB     00:00    
 * fedora: mirrors.cytanet.com.cy
 Undoing transaction 22, from Sat Dec 19 20:22:12 2009
    Install      gnokii-0.6.28-1.fc12.i686
Resolving Dependencies
--> Running transaction check
---> Package gnokii.i686 0:0.6.28-1.fc12 set to be erased
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                            Arch                             Version                                     Repository                             Size
=============================================================================================================================================================
Removing:
 gnokii                             i686                             0.6.28-1.fc12                               installed                             1.9 M

Transaction Summary
=============================================================================================================================================================
Remove        1 Package(s)
Reinstall     0 Package(s)
Downgrade     0 Package(s)

Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing        : gnokii-0.6.28-1.fc12.i686                                                                                                             1/1
warning: /etc/gnokiirc saved as /etc/gnokiirc.rpmsave

Removed:
  gnokii.i686 0:0.6.28-1.fc12                                                                                                                               

Complete!

Undoing transaction 22 creates a transaction 24. If you want to reinstall what was installed in transaction 22, do the following:

 $ sudo yum history redo 22
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Loading mirror speeds from cached hostfile
 * fedora: mirrors.cytanet.com.cy
 * rpmfusion-free: ftp-stud.hs-esslingen.de
 * rpmfusion-free-updates: ftp-stud.hs-esslingen.de
 * rpmfusion-nonfree: ftp-stud.hs-esslingen.de
 * rpmfusion-nonfree-updates: ftp-stud.hs-esslingen.de
 * updates: mirrors.cytanet.com.cy
Repeating transaction 22, from Sat Dec 19 20:22:12 2009
    Install      gnokii-0.6.28-1.fc12.i686
Resolving Dependencies
--> Running transaction check
---> Package gnokii.i686 0:0.6.28-1.fc12 set to be updated
--> Finished Dependency Resolution

Dependencies Resolved

=============================================================================================================================================================
 Package                             Arch                              Version                                     Repository                           Size
=============================================================================================================================================================
Installing:
 gnokii                              i686                              0.6.28-1.fc12                               fedora                              539 k

Transaction Summary
=============================================================================================================================================================
Install       1 Package(s)
Upgrade       0 Package(s)

Total download size: 539 k
Is this ok [y/N]: y
Downloading Packages:
gnokii-0.6.28-1.fc12.i686.rpm                                                                                                         | 539 kB     00:03   
Running rpm_check_debug
Running Transaction Test
Finished Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing     : gnokii-0.6.28-1.fc12.i686                                                                                                             1/1

Installed:
  gnokii.i686 0:0.6.28-1.fc12                                                                                                                              

Complete!



Option 'summary' associated with a package name gives the list of transaction where that package is involved.


$ sudo yum history summary gnokii
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
Login user                 | Time                | Action(s)        | Altered
-------------------------------------------------------------------------------
Askar Ali Khan      | Last day            | E, I             |        4
System              | Last 3 months       | I, O, U          |     3909
history summary



And finally here is the option 'list'


$ sudo yum history list gnokii
Loaded plugins: dellsysidplugin2, fastestmirror, refresh-packagekit
ID     | Login user             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    25 | Askar Ali Khan | 2009-12-20 12:50 | Install        |    1
    24 | Askar Ali Khan | 2009-12-20 12:46 | Erase          |    1
    22 | Askar Ali Khan | 2009-12-19 20:22 | Install        |    1
    21 | Askar Ali Khan | 2009-12-19 19:57 | Erase          |    1
     3 | System          | 2009-11-20 01:11 | I, O, U        | 1303
     2 | System          | 2009-11-20 00:21 | I, O, U        | 1303
     1 | System          | 2009-11-19 05:40 | I, O, U        | 1303
history list

No comments:

Post a Comment