1

For reasons that I won't bore you with, I would like to back up /var/lib/apt/lists to back up all of the downloaded manifests and then restore them back to that state should an apt-get upgrade fail for some reason.

So ok I tar the files up but when I restore them the system still uses the updated version of the manifests. I'm assuming after they have been downloaded these manifests are ingested into an internal database for ease of access. So how do I kick off that ingest process without doing an apt-get update?

1 Answers1

1

The package lists are indeed “ingested”, into caches stored by default in /var/cache/apt: pkgcache.bin and srcpkgcache.bin.

To force apt to only look at the indexes you’ve restored, the simplest option is to delete those caches: sudo rm /var/cache/apt/*pkgcache.bin. apt will then re-create them, using the local information, the next time it’s run with appropriate permissions; you can force that with

sudo apt-cache gencaches
Stephen Kitt
  • 434,908