Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

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

So I'm playing around with offline package installation on 12.04 Server, having downloaded packages by retrieving and wgetting their URIs using the instructions here:

I did this with apt-get upgrade and apt-get dist-upgrade, then went about installing the downloaded packages using dpkg -i. So the process looked like so:

  1. Get URIs
  2. wget the packages to a folder (upgrade packages to /upgrade and dist-upgrade packages to /dist-upgrade)
  3. run dpkg -i /upgrade/*.deb and then dpkg -i /dist-upgrade/*.deb

My question is: would this method of manually installing the updated packages correctly get everything updated, giving the same result as if I'd just run apt-get upgrade and apt-get dist-upgrade normally? Or is there something that the normal apt-get commands do that wouldn't get done with this way?

share|improve this question
up vote 5 down vote accepted

Instead of using dpkg, which is a low level package manager, you'd be better off using apt. To install the .deb files using apt, copy them to the apt cache

sudo cp *.deb /var/cache/apt/archives/

and then just do the regular apt-get upgrade. The apt command will use the files in its cache rather than downloading it off the net, so that pretty much serves your purpose.

share|improve this answer
Thanks, that works great. Though I'm still curious about what exactly apt does differently to dpkg in this case, given I originally used apt to get the URIs of all the packages, including their dependencies? When it comes to the actual act of installation it looks like apt is pretty much just using dpkg to perform the unpacking and installation of the packages, the only difference being that apt checks for dependencies beforehand (but that's already covered because I used apt to download the packages, including dependencies, in the first place). Unless I'm missing something? – R4mzy Nov 7 '13 at 17:09
Also, part of the reason I ask is that I'm concerned about what apt's behaviour might be if, say, the downloaded packages were copied onto a system that had Internet access and then apt sees that some or all of the downloaded packages are not the latest (but newer than what's currently installed) and then it rather tries to get the updated versions of those particular packages (I want it to install only the specific packages/versions that I've downloaded). Basically, does apt give preference to the latest online version or will it give preference to a local, newer-but-not-latest version? – R4mzy Nov 7 '13 at 17:19
@R4mzy You've got a valid point there. apt will try to get the latest package from the internet, even if there are older packages available locally. You might need to change /etc/apt/sources.list t make sure it installs the local packages. – sayantankhan Nov 9 '13 at 3:50

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.