Apart from aptitude
, already signaled in another answer, you could use apt-get
:
sudo apt-get --download-only --reinstall install <package names>
The --reinstall
flag is required if a package is already installed, in which case apt-get
do not want to download. The downloaded packages will be found in /var/cache/apt/archives
.
Another option is the following
apt-get --print-uris install <package names>
it will give web addresses of packages to download. In this case, no way to get the url of already installed packages.
To extract the urls you can do
apt-get --print-uris install <package names> |
awk -F\' '/http/ { print $2 }'
and to directly download the packages:
wget $(apt-get --print-uris install <package names> |
awk -F\' '/http/ { print $2 }')