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: http://www.webupd8.org/2009/11/get-list-of-packages-and-dependencies.html

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?

1 Answer 1


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 upgrade:

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.

  • 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
    Commented Nov 7, 2013 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
    Commented Nov 7, 2013 at 17:19
  • 1
    @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. Commented Nov 9, 2013 at 3:50
  • 1
    @sayantankhan can you show what that would look like in your answer? I am asking because I've copied my .deb file to /var/cache/apt/archives/ but sudo apt-get update && sudo apt-get upgrade doesnt see it or update/upgrade the package I need. I feel like I need to update the list but am not sure how.
    – Todd
    Commented Oct 19, 2016 at 14:29
  • 1
    @Todd I haven't done it myself, but here is a way someone overrode the apt package priority. Commented Oct 19, 2016 at 17:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .