Contents
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.
For developers, this related changelog might be of interest.
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.
Attribution to Sourav Rudra for this video at https://itsfoss.com/news/apt-3-2-release/ or at https://archive.ph/2afP9
Text
Steps in text format to Rollpack an APT transaction(s):
If not already done, find the requirement above
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
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.
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>
Exampleapt 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.
- Format
- Done. You have successfully Rollback an APT transaction.
Related
- Related APT commands:
Publication by Sourav Rudra at https://itsfoss.com/news/apt-3-2-release/
or at https://archive.ph/2afP9
Documentation about Rollback a Debian update
