Debian – apt: install packages downloaded previously

aptdebian

On Debian, I can download a package plus its dependent packages with

apt-get install my_desired_package --download-only

This will not install the packages, but only download them to /var/cache/apt/archives/. If I want to install the previously downloaded packages later, how would I do it (suppose I am offline)?

I can install one package with dpkg -l package1 but only if all dependencies are met.

Best Answer

apt-get always checks it's cache before performing a download. If the target package is available in /var/cache/apt/archives, then it will be installed from there and not downloaded. If the version has changed since you have done the download, you will have to specify the version manually.

apt-get install my_desired_package
apt-get install my_desired_package=1.0.1
Related Question