Introduction

The APT version 3.2.0 or more recent includes a Rollback feature. Which, when appropriate, allows you to easily and quickly Rollback an APT transaction(s). Such as a Rollback either a newly installed package or Rollback an updated package.

Requirement

APT version 3.2.0 or more recent

Steps

Choose one of the following two options:

Video

For newcomers to APT command, this short two minutes video might be of interest. Because it summarizes APT Rollback feature. Including requirement, context, and other APT related features.

Text

Steps in text format to Rollpack an APT transaction(s):

  1. If not already done, find the requirement above

  2. Each previous APT transactions has a uniquer identification number (ID). Using Console or Konsole or any other appropriate application to your liking, execute this command to find the APT transaction ID you need to Rollback to.

    • sudo apt history-list
  3. The command above will display a list of APT transaction(s). Note the appropriate APT transaction ID number you need to Rollback to. For example, number 4.

  4. Execute this command to revert everything back (Rollback) to the state at a particular point (transaction). Which undo all transaction(s) that happened after the specified transaction ID. Consider double-checking that the <ID> number is appropriate. Because this Rollback command below makes a permanent change.

    • Format
      apt history-rollback <ID>
      Example
      apt history-rollback 4

      By "permanent change" up above we mean that after executing a Rollback, it can not be undone. In other words, it is a permanent change. For example, if APT presently as a total of 10 transactions. Then, if you Rollback to transaction 4. This means that all transactions from 5 to 10 will be permanently lost. In other words, after a Rollback to 4, you can't Rollback to 10.

  5. Done. You have successfully Rollback an APT transaction.