Below are some examples of how to use the YUM history command.
View Complete YUM History
To view a full history of
transactions, we can run the command below which will show us the: transaction id, login user who executed the particular action, date and time when the operation happened, the actual action and additional information about any thing wrong with the operation:
# yum history
View Yum History
Use Yum to Find Package Info
The history sub-commands: info/list/summary can take a transaction ID or package name as an argument. Additionally, the list sub-command can take a special argument, all meaning – all transactions.
The previous history command is equivalent to running:
# yum history list all
And, you can view details of transactions concerning a given package such as httpd web server with the info command as follows:
# yum history info httpd
Yum – Find Package Info
To get a summary of the transactions concerning httpd package, we can issue the following command:
# yum history summary httpd
Yum – Find Summary of Package
It is also possible to use a transaction ID, the command below will display details of the transaction ID 15.
# yum history info 15
Yum – Find Package Info Using ID
Use Yum History to Find Package Transaction Info
There are sub-commands that print out transaction details of a specific package or group of packages. We can use package-list or package_info to view more info about httpd package like so:
# yum history package-list httpd
# yum history package-info httpd
Yum – Find Package Transaction Info
To get history about multiple packages, we can run:
# yum history package-list httpd epel-release
# yum history packages-list httpd epel-release
Yum – Find Multiple Packages Info
Use Yum to Rollback Packages
Furthermore, there are certain history sub-commands that enable us to: undo/redo/rollback transactions.
Undo – will undo a specified transaction.
redo – repeat the work of a specified transaction
rollback – will undo all transactions up to the point of the specified transaction.
They take either a single transaction id or the keyword last and an offset from the last transaction.
For example, assuming we’ve done 60 transactions, “last” refers to transaction 60, and “last-4” points to transaction 56.
If You Appreciate What We Do Here On TecMint, You Should Consider:
TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.
If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.
Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.