I'm currently running Ubuntu 20.04.4 LTS
.
Four times over the past year or two, my apt
database got screwed up somehow (I don't know how), and the next time I ran apt
, apt-get
, and aptitude
, I was told that I have more than 1,000 packages that are set up to be removed. If I did an autoremove
with the intention of later trying to reinstall, my entire system would have become unusable, because most of the normal, everyday programs would then have been removed during that autoremove
.
I did not (!!!) delete the top-level desktop package, nor any top-level package. This error occurred due to something (??? I don't know what) which somehow damaged the integrity of the apt
databases on my machine.
I was able to fix this each time by going through the procedure which I have outlined in the "Answer" to this question: Fixing broken apt **without** destroying my system via "apt autoremove"
However, the fact that this has occurred multiple times means that whatever caused this might cause it to happen again. In order to help fix this situation if/when it happens again, I'd like to know the following ...
What directories on my system should I back up if I want to preserve the state of the entire apt
system at any given time? I want to take periodic backups of all of these apt
-related directories, so that next time this error occurs, I could quickly restore my apt
environment by restoring all of these directories to their last backed-up versions.
Thank you for any pointers and suggestions as to what directories I should back up in order to preserve the integrity of my entire apt
environment.