As you may know we can use apt-get install --print-uris -y package-name
and it show us a list of URLs, hashsum, etc.
However if we use it for a package that already has been installed on system it does not work:
Reading package lists... Done
Building dependency tree
Reading state information... Done
package is already the newest version (x.x-x).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
So how can I get a list of necessary URLs using apt
or other CLI tools like aptitude
?
PS: I Don't want to use packages.ubuntu.com.
Not all installed packages will have a URL associated with them, of course. However, you could use
apt-get dowload
:This is the candidate version as shown by
apt-cache policy
, which might not necessarily be the installed version.It seems to be sufficient to add the
--reinstall
flag (at least on my 16.04 system) e.g.but
NOTE: this doesn't work if the package is currently cached:
but after clearing the cache