Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
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
up vote 7 down vote accepted

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
share|improve this answer
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
@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 posting your answer, you agree to the privacy policy and terms of service.

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