Chapter 9. Handling package management history

The yum history command allows you to review the following information

  • Timeline of YUM transactions
  • Dates and times the transactions occurred
  • Number of packages affected by the transactions
  • Whether the transactions succeeded or were aborted
  • If the RPM database was changed between transactions

The yum history command can also be used to undo or redo the transactions.

The following section describes how to use yum to handle package management history in Red Hat Enterprise Linux 9:

9.1. Listing transactions

The following procedure describes how to list the latest YUM transactions, the latest operations for a selected package, and details of a particular transaction.

Procedure

  • To display a list of all the latest YUM transactions, use:

    # yum history
  • To display a list of all the latest operations for a selected package, use:

    # yum history list package-name

    Replace package-name with the name of the package. You can filter the command output by appending global expressions. For more details, see Specifying global expressions in yum input.

  • To display details of a particular transaction, use:

    # yum history info transactionID

    Replace transactionID with the ID of the transaction.

9.2. Reverting transactions

The following procedure describes how to revert a selected transaction or the last transaction using yum.

Procedure

  • To revert a particular transaction, use:

    # yum history undo transactionID

    Replace transactionID with the ID of the transaction.

  • To revert the last transaction, use:

    # yum history undo last

Note that the yum history undo command only reverts the steps that were performed during the transaction. If the transaction installed a new package, yum history undo uninstalls it. If the transaction uninstalled a package, yum history undo reinstalls it. The yum history undo command also attempts to downgrade all updated packages to their previous versions, if the older packages are still available.

9.3. Repeating transactions

The following procedure describes how to repeat a selected transaction or the last transaction using yum.

Procedure

  • To repeat a particular transaction, use:

    # yum history redo transactionID

    Replace transactionID with the ID of the transaction.

  • To repeat the last transaction, use:

    # yum history redo last

Note that the yum history redo command only repeats the steps that were performed during the transaction.