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.

  • Can you install all of them using: dpkg -l *? I don't know, its just a guess. – Kevdog777 Dec 19 '13 at 15:58
  • @Kevdog777 Since they are downloaded to /var/cache/apt/archives, that wouldn't be a good idea. – jordanm Dec 19 '13 at 16:00

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
  • Isn't that just installing them, when you are online? I thought the OP was saying to download them now, then install them at a later stage, when they are offline... no? Good answer though. – Kevdog777 Dec 19 '13 at 16:06
  • 2
    @Kevdog777 if the packages are downloaded already, and the version/sums fits what it's in the package list, apt-get won't try to connect to internet, so is like you are offline ;). – Braiam Dec 19 '13 at 16:08
  • Ah ok, I didn't know that, TBH. Thanks :) – Kevdog777 Dec 19 '13 at 16:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.