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
  • 1
    I suggest using the apt-offline package, a safer alternative than manually mucking about with apt files.
    – user535733
    Oct 3, 2021 at 21:48

1 Answer 1

-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.

3
  • Link only answers aren't actually full answers. If you no longer need help since you found these other answers, we can close this question as a duplicate of the one that helped you, however this does not stand on its own as an answer.
    – Thomas Ward
    Oct 4, 2021 at 15:34
  • @Thomas Ward, I don't agree. The linked answer concerns with only installed packages and dkpg, the finding that the solution applies to making apt download packages again is IMO additional finding. Judging that as triviality assumes knowledge of apt/dpkg interaction, but if we assume having knowledge, why this site is needed at all? Oct 5, 2021 at 4:57
  • 1
    the point of my asking was to determine if this can be closed as a duplicate question. As you state in your answer: "I found several other Q/As that explain how things work" and also "I stumbled upon ... tried to copy the ... file over and looks like it works". In both cases, this answer is insufficient to stand as its own as it relies on links that could go dark whenever as the answer. Per the Help Center, these count as link only answers and those do not count as complete proper answers.
    – Thomas Ward
    Oct 5, 2021 at 14:42

Not the answer you're looking for? Browse other questions tagged .