9.4. Working with Transaction History
yum history command enables users to review information about a timeline of yum transactions, the dates and times they occurred, the number of packages affected, whether these transactions succeeded or were aborted, and if the RPM database was changed between transactions. Additionally, this command can be used to undo or redo certain transactions. All history data is stored in the history DB in the /var/lib/yum/history/ directory.
9.4.1. Listing Transactions
root, either run yum history with no additional arguments, or type the following at a shell prompt:
yumhistorylist
all keyword:
yumhistorylistall
yumhistoryliststart_id..end_id
yumhistorylistglob_expression…
Example 9.19. Listing the five oldest transactions
yum history list, the most recent transaction is displayed at the top of the list. To display information about the five oldest transactions stored in the history data base, type:
~]# yum history list 1..5
Loaded plugins: langpacks, product-id, subscription-manager
ID | Login user | Date and time | Action(s) | Altered
-------------------------------------------------------------------------------
5 | User <user> | 2013-07-29 15:33 | Install | 1
4 | User <user> | 2013-07-21 15:10 | Install | 1
3 | User <user> | 2013-07-16 15:27 | I, U | 73
2 | System <unset> | 2013-07-16 15:19 | Update | 1
1 | System <unset> | 2013-07-16 14:38 | Install | 1106
history listyum history list command produce tabular output with each row consisting of the following columns:
ID— an integer value that identifies a particular transaction.Login user— the name of the user whose login session was used to initiate a transaction. This information is typically presented in theFull Name <username>form. For transactions that were not issued by a user (such as an automatic system update),System <unset>is used instead.Date and time— the date and time when a transaction was issued.Action(s)— a list of actions that were performed during a transaction as described in Table 9.1, “Possible values of the Action(s) field”.Altered— the number of packages that were affected by a transaction, possibly followed by additional information as described in Table 9.2, “Possible values of the Altered field”.
Table 9.1. Possible values of the Action(s) field
| Action | Abbreviation | Description |
|---|---|---|
Downgrade | D | At least one package has been downgraded to an older version. |
Erase | E | At least one package has been removed. |
Install | I | At least one new package has been installed. |
Obsoleting | O | At least one package has been marked as obsolete. |
Reinstall | R | At least one package has been reinstalled. |
Update | U | At least one package has been updated to a newer version. |
Table 9.2. Possible values of the Altered field
| Symbol | Description |
|---|---|
< | Before the transaction finished, the rpmdb database was changed outside yum. |
> | After the transaction finished, the rpmdb database was changed outside yum. |
* | The transaction failed to finish. |
# | The transaction finished successfully, but yum returned a non-zero exit code. |
E | The transaction finished successfully, but an error or a warning was displayed. |
P | The transaction finished successfully, but problems already existed in the rpmdb database. |
s | The transaction finished successfully, but the --skip-broken command-line option was used and certain packages were skipped. |
rpmdb or yumdb database contents for any installed package with the currently used rpmdb or yumdb database, type the following:
yumhistorysync
yumhistorystats
Example 9.20. Example output of yum history stats
~]# yum history stats
Loaded plugins: langpacks, product-id, subscription-manager
File : //var/lib/yum/history/history-2012-08-15.sqlite
Size : 2,766,848
Transactions: 41
Begin time : Wed Aug 15 16:18:25 2012
End time : Wed Feb 27 14:52:30 2013
Counts :
NEVRAC : 2,204
NEVRA : 2,204
NA : 1,759
NEVR : 2,204
rpm DB : 2,204
yum DB : 2,204
history stats
root:
yumhistorysummary
yumhistorysummarystart_id..end_id
yum history list command, you can also display a summary of transactions regarding a certain package or packages by supplying a package name or a glob expression:
yumhistorysummaryglob_expression…
Example 9.21. Summary of the five latest transactions
~]# yum history summary 1..5
Loaded plugins: langpacks, product-id, subscription-manager
Login user | Time | Action(s) | Altered
-------------------------------------------------------------------------------
Jaromir ... <jhradilek> | Last day | Install | 1
Jaromir ... <jhradilek> | Last week | Install | 1
Jaromir ... <jhradilek> | Last 2 weeks | I, U | 73
System <unset> | Last 2 weeks | I, U | 1107
history summaryyum history summary command produce simplified tabular output similar to the output of yum history list.
yum history list and yum history summary are oriented towards transactions, and although they allow you to display only transactions related to a given package or packages, they lack important details, such as package versions. To list transactions from the perspective of a package, run the following command as root:
yumhistorypackage-listglob_expression…
Example 9.22. Tracing the history of a package
~]# yum history package-list subscription-manager\*
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
ID | Action(s) | Package
-------------------------------------------------------------------------------
2 | Updated | subscription-manager-1.13.22-1.el7.x86_64 EE
2 | Update | 1.15.9-15.el7.x86_64 EE
2 | Obsoleted | subscription-manager-firstboot-1.13.22-1.el7.x86_64 EE
2 | Updated | subscription-manager-gui-1.13.22-1.el7.x86_64 EE
2 | Update | 1.15.9-15.el7.x86_64 EE
2 | Obsoleting | subscription-manager-initial-setup-addon-1.15.9-15.el7.x86_64 EE
1 | Install | subscription-manager-1.13.22-1.el7.x86_64
1 | Install | subscription-manager-firstboot-1.13.22-1.el7.x86_64
1 | Install | subscription-manager-gui-1.13.22-1.el7.x86_64
history package-list9.4.2. Examining Transactions
root, use the yum history summary command in the following form:
yumhistorysummaryid
root:
yumhistoryinfoid…
yumhistoryinfostart_id..end_id
Example 9.23. Example output of yum history info
~]# yum history info 4..5
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
Transaction ID : 4..5
Begin time : Mon Dec 7 16:51:07 2015
Begin rpmdb : 1252:d2b62b7b5768e855723954852fd7e55f641fbad9
End time : 17:18:49 2015 (27 minutes)
End rpmdb : 1253:cf8449dc4c53fc0cbc0a4c48e496a6c50f3d43c5
User : Maxim Svistunov <msvistun>
Return-Code : Success
Command Line : install tigervnc-server.x86_64
Command Line : reinstall tigervnc-server
Transaction performed with:
Installed rpm-4.11.3-17.el7.x86_64 @rhel-7-server-rpms
Installed subscription-manager-1.15.9-15.el7.x86_64 @rhel-7-server-rpms
Installed yum-3.4.3-132.el7.noarch @rhel-7-server-rpms
Packages Altered:
Reinstall tigervnc-server-1.3.1-3.el7.x86_64 @rhel-7-server-rpms
history inforoot:
yumhistoryaddon-infoid
yum history info, when no id is provided, yum automatically uses the latest transaction. Another way to refer to the latest transaction is to use the last keyword:
yumhistoryaddon-infolast
Example 9.24. Example output of yum history addon-info
yum history addon-info command provides the following output:
~]# yum history addon-info 4
Loaded plugins: langpacks, product-id, subscription-manager
Transaction ID: 4
Available additional history information:
config-main
config-repos
saved_tx
history addon-infoyum history addon-info command, three types of information are available:
config-main— global yum options that were in use during the transaction. See Section 9.5.1, “Setting [main] Options” for information on how to change global options.config-repos— options for individual yum repositories. See Section 9.5.2, “Setting [repository] Options” for information on how to change options for individual repositories.saved_tx— the data that can be used by theyum load-transactioncommand in order to repeat the transaction on another machine (see below).
root:
yumhistoryaddon-infoid information
9.4.3. Reverting and Repeating Transactions
yum history command provides means to revert or repeat a selected transaction. To revert a transaction, type the following at a shell prompt as root:
yumhistoryundoid
root, run the following command:
yumhistoryredoid
last keyword to undo or repeat the latest transaction.
yum history undo and yum history redo commands only revert or repeat the steps that were performed during a transaction. If the transaction installed a new package, the yum history undo command will uninstall it, and if the transaction uninstalled a package the command will again install it. This command also attempts to downgrade all updated packages to their previous version, if these older packages are still available.
root:
yum-qhistoryaddon-infoidsaved_tx>file_name
root:
yumload-transactionfile_name
load-transaction to ignore missing packages or rpmdb version. For more information on these configuration options see the yum.conf(5) man page.
9.4.4. Starting New Transaction History
root:
yumhistorynew
/var/lib/yum/history/ directory. The old transaction history will be kept, but will not be accessible as long as a newer database file is present in the directory.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.