Is there a way, before starting an
aptitude upgrade or
apt-get upgrade, to set up something so that you can "easily" rollback your system to the "apt" state it was before the actual upgrade, if something goes wrong?
That is, for example, reinstall the old version of the packages that were upgraded during the process.
(EDIT) A few hints: I know that
etckeeper for example uses some hook on
apt so that it is notified whenever
apt installs or uninstalls a package. I suppose there could be some kind of script that could save the list of newly installed package and their previous version number to be able to reinstall them from the
apt cache (
/var/cache/apt/archives). There is also
checkinstall which can keep track of file modifications...
Any details on how to achieve that properly?