The cart is empty

YUM (Yellowdog Updater Modified) package manager is a fundamental tool in Red Hat-based distributions like CentOS, enabling users to install, update, and remove software packages. One lesser-known but highly useful feature of YUM is its ability to record transaction history, allowing users to view and revert changes made to the system. This article provides a detailed overview of how to use YUM history for diagnosing and resolving package issues on CentOS 7.

YUM History: Overview and Significance

YUM history is a tool that provides a chronological list of all transactions performed using YUM, including installations, updates, removals, and other package actions. Each transaction is assigned a unique ID, which can be used for further investigation or manipulation.

Why Use YUM History

  1. Issue Diagnosis: YUM history allows for quick identification of recently installed or updated packages, which can be helpful in pinpointing the cause of newly emerged issues.
  2. Rolling Back Changes: If an update or installation of a package causes problems, YUM history enables the easy rollback of that action.

How to Use YUM History for Issue Resolution

Viewing Transaction History

To display the complete transaction history, execute the following command in the terminal:

yum history

This command will show a list of all transactions performed using YUM, including the transaction ID, date and time, action (installations, updates, removals), and a brief description.

Detailed Examination of a Transaction

To view detailed information about a specific transaction, use the yum history info command followed by the transaction ID:

yum history info <ID>

This command provides detailed information about the transaction, including a list of all packages that were installed, updated, or removed.

Reverting Changes Made by Transactions

If you need to revert the changes made during a specific transaction, use the following command:

yum history undo <ID>

This command will revert all actions (installations, updates, removals) performed within the specified transaction.

Restoring a Corrupted YUM Database

In case the YUM database is corrupted and standard operations cannot be performed, you can use the yum history new tool to initialize a new database without losing historical data.

yum history new

YUM history is a powerful tool that can significantly ease the diagnosis and resolution of package-related issues on CentOS 7 systems. Its ability to display detailed transaction history, examine specific transactions, and revert changes allows administrators to maintain a stable and secure system. By regularly utilizing this tool, software package management can become more efficient and less prone to errors.