Is there any easy way to get the direct download link of all updates in ubuntu?

When a long list of new updates are available, I prefer to use a download manager in another computer to download .deb files of updates. Is there any easy way to get the direct download link of .deb files of all updates (from an update manager) in Ubuntu 12.10?


Solution 1:

On the command line:

apt-get update
apt-get --print-uris upgrade

To extract the URLs from the output:

apt-get --print-uris --yes upgrade | awk '/^'\''/ {sub(/^./,"",$1); sub(/.$/,"",$1); print $1, $2}'

This snippet prints the URL for each package followed by the local file name. The local file name is usually the same as in the URL, but occasionally differs (I think only for packages whose version has an epoch).

If you can run wget on the computer with the network connection, use apt-zip Install apt-zip which automates this task: it provides a tool that generates a shell script to perform the download, and a tool to import the downloaded packages. You can use that script even on a Windows machine, with a port of Unix tools such as Cygwin.

Solution 2:

You can do this with synaptic,

sudo apt-get install synaptic

Click the buttons "Reload", "Mark All Upgrades", and then from the menu select File->Generate package download script.

Take the generated script and run it on another computer, and then use the menu option File->Add downloaded packages to install them, or do it manually with dpkg.