This question already has an answer here:

I need to install offline packages for a linux server. it is a repellent task because all the time it outputs that the package I want to install needs several other packages.

How can I resolve this problem, please ? Regards

marked as duplicate by Warren Hill, jobin, user117103, Richard, belacqua Apr 4 '14 at 0:40

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • Thank you but Keryx is using a graphical user interfcace which is not adequate for a server – user284234 Apr 3 '14 at 7:42
  • 1
    There are other options too. Wait a minute....... why do you need to install software offline on a server? a server is meant to be always online, isn't it? – Registered User Apr 3 '14 at 7:54
  • 1
    @RegisteredUser, There are several cases where a server is on a separate network that is completely inside a corporate firewall. It's always on the isolated network and never on the public internet. – Berin Loritsch Jan 13 '16 at 15:09

You could try with dpkg-offline:

dpkg-offline obtains a package's dependencies, starting from a known set of packages (as for a base installation), fetches those .debs and packages them up in a tarball. Ideal for offline installation of the "seed" package.

First branch the project on launchpad:

bzr branch lp:dpkg-offline

dpkg_offline tutorial

Let's say you want to create a tarball with all the dependencies necessary to install git on an Ubuntu 12.04 server system.

Once you have dpkg_offline, ensure you have the needed dependencies installed:

sudo apt-get install genisoimage mtools squashfs-tools apt-utils curl

Once they're installed, get your seed .iso image::

wget http://releases.ubuntu.com/precise/ubuntu-12.04.4-server-amd64.iso

Now you're all set to do the installation. Run this:

./dpkg_offline ubuntu-12.04.4-server-amd64.iso "git"

The first argument is the seed iso, while the second is a list of packages to install. Using quotes is necessary so that the second "thing" is taken as the whole list. Of course, it's not necessary if you have only one seed package.

If the process completes successfully, a tarball will be left in the current directory. The name will encode the seed ISO, creation date, and the base packages that were installed:


If something fails, dpkg_offline will tell you what failed and point you to a log file that may contain more details about the failure. This file will be in a temporary directory; dpkg_offline normally cleans this directory up, but in the case of a failure it will leave it as-is for analysis.

  • 1
    I've updated the tutorial using a server iso – Sylvain Pineau Apr 3 '14 at 7:48
  • 1
    All you need is an Ubuntu system connected from where you can download the server iso, it does not need to be a server. run dpkg-offline on this machine and copy the resulting tar.gz on a usb drive – Sylvain Pineau Apr 3 '14 at 7:56
  • 1
    @LuísdeSousa, dpkg-offline is not apt-offline, but I will update the question marked as duplicated. Thanks – Sylvain Pineau Apr 3 '14 at 8:10
  • 1
    You have to branch it using bzr branch lp:dpkg-offline, I've edited my post. sudo apt-get install bzr if you don't have it installed. – Sylvain Pineau Apr 3 '14 at 8:15
  • 1
    If the package is not in a ppa but in Ubuntu archives, just download the server iso and give to dpkg-offline the name of the seed package, that's all – Sylvain Pineau Apr 3 '14 at 8:24