You can using --print-uris
parameter:
sudo apt-get -y --print-uris upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
m4
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 250 kB of archives.
After this operation, 39.9 kB disk space will be freed.
'http://ftp.us.debian.org/debian/pool/main/m/m4/m4_1.4.17-2_i386.deb' m4_1.4.17-2_i386.deb 249782 MD5Sum:d0611ffe92bb0d666492333f3c652b40
you can make it more quiet:
sudo apt-get -qqq -y --print-uris upgrade
'http://ftp.us.debian.org/debian/pool/main/m/m4/m4_1.4.17-2_i386.deb' m4_1.4.17-2_i386.deb 249782 MD5Sum:d0611ffe92bb0d666492333f3c652b40
Then redirect the output using stdout redirections:
➜ ~ sudo apt-get -qqq -y --print-uris upgrade > upgrade
➜ ~ cat upgrade
'http://ftp.us.debian.org/debian/pool/main/m/m4/m4_1.4.17-2_i386.deb' m4_1.4.17-2_i386.deb 249782 MD5Sum:d0611ffe92bb0d666492333f3c652b40
I would recommend to do sudo apt-get clean
to prevent that apt-get doesn't print the uris of previous downloaded packages.
keryx
regularly. See http://askubuntu.com/a/181913/58950 – carnendil Jan 31 '14 at 20:53