This will download all packages and dependencies (no already installed) to a directory of your choice:
sudo apt-get install -d -o Dir::Cache=/path-to/directory/apt/cache -o Dir::State::Lists=/path-to/directory/apt/lists packages
Make sure /path-to/directory/apt/cache
and /path-to/directory/apt/lists
exist.
If you don't set -o Dir::Cache
it points to /var/cache/apt
,
Dir::State::Lists
points to /var/lib/apt/lists
(which keeps the index files of available packages)
Both -o
options can be used with update and upgrade instead of install.
On different machine run the same command without '-d
'