“yum history” Command in Red Hat and CentOS Linux

YUM (Yellowdog Update Modified) is a rpm-based package manager for RedHat, CentOS, Fedora, Oracle Linux etc. YUM command is used to install/remove or modify packages from a Linux System. “yum history” command is useful whenever you want to list, undo, redo and rollback command executed by yum command. In this post, we’ll see how effectively we can use “yum history” command. Let’s see some of the “yum History” command with examples.
1. Listing transactions.
This command shows all YUM command executed which also shows Transaction ID, Command line, Date and time, Actions(Install/Erase) etc. By default, it will show 20 transactions only.
# yum history
# yum history list
Summary of the transaction history:
ID – Transactions Value
Command line – Shows command line
Date and time – Date and time the transactions was executed.
Action(s)– List of actions i.e Install, Update and Erase packages. The name of the user logged in to the system to initiate a transaction.
Altered – Number of packages are affected by transactions.
2. How to get a summary of the transactions with ID or package
Below command shows the summary of the transactions with ID or package.
# yum history summary 7
OR
# yum history summary perl-DBD-MySQL
3. Information for a specific transaction
You can get the detail information of transaction ID or package name with below command.
# yum history info 7
OR
# yum history info perl-DBD-MySQL
4. Undo transaction
You can undo a specific transaction ID using below command.
# yum history undo 7
5. Redo will removed perl-DBD-MySQL package command shown in below which was installed earlier.
# yum history redo 7
6. Rollback transaction from certain point
Rollback options allows us to completely revert all the updates that have installed / removed or updated till ID 4 below screenshot. We have installed / updated / removed in separate transactions as show below.
If you run below command will reverts the earlier changes made. 
#  yum history rollback 4
Conclusion: In this tutorial, YUM history command with options for YUM transactions. Big thanks for reading all the way to the end. Please share it with Your Friends & Help Someone… and also Like Our Facebook Page. Let me hear your thoughts in the comments below!

Leave a Comment