yum history: list, undo and redo transactions
List yum transaction history, undo or redo a transaction, and change how yum history list displays entries.
yum records every transaction (install, update, erase, etc.) in its history. The yum history command lists these transactions, shows their details, and lets you undo or redo them.
Check that history is recorded
ls -l /var/lib/yum/history/
List the history
yum history
yum history list
yum history list 7
yum history list 1..3
yum history list kernel
yum history list nginx
Transaction details
yum history info 112
yum history summary
yum history summary 1..3
yum history addon-info 24
yum history addon-info last
addon-info shows the additional information available for a transaction.
Output columns
| Column | Meaning |
|---|---|
| ID | Transaction number. |
| Login user | User whose session ran the yum command. |
| Date and time | Date and time when the transaction was run. |
| Action(s) | Actions performed: D (Downgrade), E (Erase), I (Install), O (Obsoleting), R (Reinstall), U (Update). |
| Altered | Number of packages affected, followed by a status symbol (see the table below). |
| Symbol | Meaning |
|---|---|
< |
The rpmdb database was changed outside yum before the transaction finished. |
> |
The rpmdb database was changed outside yum after the transaction finished. |
* |
The transaction failed to finish. |
# |
The transaction finished, but yum returned a non-zero exit code. |
E |
The transaction finished, but an error or warning was displayed. |
P |
The transaction finished, but problems already existed in the rpmdb database. |
s |
The transaction finished, but --skip-broken was used and some packages were skipped. |
Undo a transaction
To undo a transaction, use its ID:
yum history undo <id>
Example:
yum history undo 29
yum history package-list nginx
Redo a transaction
yum history redo <id>
Find the user behind a transaction
For a transaction run through PackageKit, the system journal shows the user:
journalctl -u PackageKit | grep yum | grep -i 'user='
Change the display of yum history list
The history_list_view option accepts the following values:
| Value | Display |
|---|---|
users |
Login of the user. |
commands |
Command line. |
single-user-commands |
Command line if the login is always the same, otherwise the login. |
For a single call:
yum --setopt=history_list_view=users history list
yum --setopt=history_list_view=commands history list
yum --setopt=history_list_view=single-user-commands history list
For a permanent setting, add the following line in the [main] section of /etc/yum.conf:
history_list_view=single-user-commands
Notes
- Transaction IDs (29, 112, 24...) are examples.