2014-08-04 - I've been using an offline downloading solution for some time, but haven't had the time to write up a proper HOWTO.
Archives are normally stored in /var/cache/apt/archives/
, but I wanted to know how to download an archive directly to a specified directory.
Tested on:
- Lubuntu 13.04
-
apt 0.9.7.7ubuntu4 for amd64 compiled on Apr 12 2013 23:49:01
\sudo \apt-get \ -o Dir::Cache::archives=./ \ --force-reinstall true \ --yes \ download \ PROGRAM1 \ PROGRAM2 \ ` # `
I still have no idea how to download the dependency chain. See also Scripting Ubuntu dependency downloading[doesn't exist].
Notes ∞
There's one idea where you can tell your system that it /has no packages installed/. Then you can ask to download a program (and supposedly its dependencies) without installing. Then you restore your system's previous state.
An interesting idea, but I didn't get anywhere with it (not enough serious testing). I'm looking at other methods right now, and these rough notes are here for possible future reference.
dpkg --get-selections > ~/my-packages
This puts a list of all your installed packages and their status into a file named my-packages in your home directory. You can run
sudo dpkg --set-selections < my-packages && sudo apt-get dselect-upgrade
\sudo \rm --force ./packages \sudo \dpkg --get-selections > packages \sudo \dpkg --clear-selections \sudo \apt-get clean \sudo \apt-get \ -o Dir::Cache::archives=./ \ --force-reinstall true \ --yes \ download \ PROGRAM1 \ PROGRAM2 \ ` # ` \sudo \dpkg --set-selections < packages \sudo \apt-get deselect-upgrade
Last updated 2014-08-06 at 00:21:05