0

I've read Snapshot and rollback of apt-installed packages and What does reading database mean in Apt?. My task (IMHO) is simpler than 1st question (for which there is no accepted answer): no need to roll-back, I envision saving enough of apt / dpkg state to allow to temporarily substitute saved files to be able to use apt-get install --download-only from saved state.

What files (database?) are needed to be backed up and replaced? Any clearance / fix consistency commands needed after such substitution?

Via this procedure I expect to get needed packages for installation on a offline computer.

1 Answers1

-1

I've stumbled upon Read full dpkg database state without dpkg program. Tried to copy /var/lib/dpkg/status file over and looks like it works.

TL;DR

During search for the answer I found also several QAs explaining ways to work with distributing deb packages that might be useful along with the above:

Non-LAN solution https://askubuntu.com/a/1358370/1152748 suggests using apt-ftparchive to setup local apt deb files location to be used for search and install by standard apt way.

For LAN: Best way to cache apt downloads on a LAN?

https://askubuntu.com/a/1213030/1152748 answer explains how to use apt-mark.