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
22 | Askar Ali Khan
21 | Askar Ali Khan
20 | System
19 | System
18 | System
17 | System
16 | System
15 | System
14 | Askar Ali Khan
13 | System
12 | Askar Ali Khan
11 | Askar Ali Khan
10 | Askar Ali Khan
9 | Askar Ali Khan
8 | Askar Ali Khan
7 | Askar Ali Khan
6 | Askar Ali Khan
5 | Askar Ali Khan
4 | System
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
System
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
24 | Askar Ali Khan
22 | Askar Ali Khan
21 | Askar Ali Khan
3 | System
2 | System
1 | System
history list
No comments:
Post a Comment