Disclaimer: Nala is still in a development stage, and is not recommended for any professional use.
For apt
packages
If you're ready to use the command line to install new packages, it's possible to get an easy undo feature with the more modern apt
front-end called nala
(for 22.04 you have to enable the "universe" repository). Note: This will only work for apt
/.deb
packages.
sudo apt install nala
From this point, use nala
to install new packages on your system, using:
sudo nala install <package-name>
Leave security updates etc. to the unattended-upgrades
package.
Now, when you run the command nala history
, you get a list of the commands run with nala, including installed packages. To filter only new installations, use:
nala history | grep install
An added bonus of the history feature is that you can undo any step in the history, so that you can easily reverse package installation procedures. This can be done by issuing the command:
sudo nala history undo <ID>
Where <ID>
is the ID number of the transaction in the history list you want to undo.
For snap
packages
Snap has its own "undo" feature, where you can easily revert to the previously installed version. This is done with:
sudo snap revert <package-name>
In case you want to revert to a specific revision of a snap package, this can be stated as well;
sudo snap revert <package-name> --revision <rev ID>
For snaps, also see here.