Will apt-get download the same version of a package manually added to /var/cache/apt/archives?

Imagine, I have all packages to install, say, ddd.
If I copy all ddd packages to /var/cache/apt/archives and run sudo apt-get install ddd in terminal, will apt-get re-download the packages or skip them?

PS I currently have ddd installed, so I can't (won't) test it myself. So I need some expert to tell me what would happen :)


Solution 1:

Yes it will, but only if the package is part of any lists that where downloaded while doing a apt-get update, eg:

  • You get a package that comes from a PPA that you want to use and you add the package manually to /var/cache/apt/archives, because the version of the package is not present on any package list from your sources it will not be used.

Packages are also signed, so if the signature from the package does not match the expected signature then it will be downloaded again, package identification does not depend on the name of the file only.

Making it short: if the manually added package version and signature match anything in your sources package list then that package will be used, else it will be downloaded again.

Solution 2:

No , It would not download it again. Here I am installing a previously uninstalled package which is present in my /var/cache/apt/archives directory.

sudo apt-get install artha

enter image description here