Score:0

Snapshot of apt / dpkg state to allow to download deb files from that state

ec flag

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.

user535733 avatar
cn flag
I suggest using the `apt-offline` package, a safer alternative than manually mucking about with apt files.
Score:-1
ec flag

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.

ru flag
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.
Martian2020 avatar
ec flag
@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?
ru flag
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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.