0

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

Braiam
  • 67,791
  • 32
  • 179
  • 269
  • Thank you but Keryx is using a graphical user interfcace which is not adequate for a server –  Apr 03 '14 at 07: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 03 '14 at 07: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

1 Answers1

2

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:

apt-repo-ubuntu-12.04.4-server-amd64.iso-20131213-git_13a1.7.9.5-1_amd64.tar.gz

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.

  • Thank you very much for your answer, but I read on the official documentation that dpkg does not resolve the dependencies problem. –  Apr 03 '14 at 07:41
  • And my problem is with the server edition, not the desktop one –  Apr 03 '14 at 07:44
  • This tools is called dpkg-offline but it uses the power of apt inside. We use it a lot for offline setup at Canonical – Sylvain Pineau Apr 03 '14 at 07:44
  • Just select a server iso in that case, it will work the same way. – Sylvain Pineau Apr 03 '14 at 07:45
  • I will try your solution –  Apr 03 '14 at 07:46
  • 1
    I've updated the tutorial using a server iso – Sylvain Pineau Apr 03 '14 at 07:48
  • And how can I do if my server has no internet connection since the start and will never be connected to internet ? –  Apr 03 '14 at 07:50
  • 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 03 '14 at 07:56
  • It would have been better if you had posted this answer to the question marked as duplicated. Also note that apt-offline is already mentioned there. – Luís de Sousa Apr 03 '14 at 08:06
  • 1
    @LuísdeSousa, dpkg-offline is not apt-offline, but I will update the question marked as duplicated. Thanks – Sylvain Pineau Apr 03 '14 at 08:10
  • Sylvain: there is no documentation on how to install dpkg_offline, not even a download link (i visited your page) –  Apr 03 '14 at 08:11
  • 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 03 '14 at 08:15
  • Luís de Sousa : my question has nothing to do with your link because I deal with a server –  Apr 03 '14 at 08:15
  • it says: you have not informed bzr of your Lanched ID, but it is downloaded anyway, –  Apr 03 '14 at 08:21
  • Once dkg_offline is downloaded: can i use it directly with the command you gave me in the tutorial or must i perform something before that ? –  Apr 03 '14 at 08:22
  • 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 03 '14 at 08:24
  • The list of arguments to give to dpkg_offline must be separated by a comma or a space, please ? –  Apr 03 '14 at 08:25
  • 1
    spaces, look at the README and tutorial here for further options if needed: http://bazaar.launchpad.net/~roadmr/dpkg-offline/trunk/files – Sylvain Pineau Apr 03 '14 at 08:26
  • Sylvain, it is precisely because apt-offline is not dpkg-offline that I am calling your attention. Before posting an answer please make sure that the question is not a duplicate. – Luís de Sousa Apr 03 '14 at 08:26
  • I am learning new things here Sousa, and I have been desperate to resolve this problem, and you are suggesting me GUI based stuff that is not performant and which I can not use anyway. The solution of Sylvain, if it works, is the best in the world. –  Apr 03 '14 at 08:29
  • when I run the command ./dpkg_offline my_server.iso "pkg1.deb pkg2.deb" it says to me that no squashes from iso found and that i am using an old server (which is true). How can i fix this trouble ? because i want to use that specific old server. –  Apr 03 '14 at 08:40
  • a 12.04 server or older? – Sylvain Pineau Apr 03 '14 at 08:50
  • 1
    For 12.04, indeed you can't use the iso. Please follow these additional steps to get a tar.gz that can replace the ISO. – Sylvain Pineau Apr 03 '14 at 09:02
  • It is working. Thank you a lot and a lot, Sylvain. –  Apr 03 '14 at 09:46
  • Yes, older than 12.04 –  Apr 03 '14 at 09:47
  • I know that the process is a bit long to set up for the first time but I'm happy to see that it worked for you. Upvote my answer (^) please. – Sylvain Pineau Apr 03 '14 at 09:48
  • I did already, 4 hours ago :) Thank you very much Sylvain. –  Apr 03 '14 at 14:41
  • Sorry, voting is not the same as accepting, you need to click on the ^ mark above the 0 (and the checkbox). – Sylvain Pineau Apr 03 '14 at 14:44
  • I am new to this website. I did what you asked me, hope it is correct. Thank you again very much for your help today. –  Apr 03 '14 at 14:50
  • Guys, can any of these comments be removed? They've kinda overflowed. Any important information should be edited into either the question or answer (as needed). Comments are meant to be (rather) temporary so if there is anything important here please make sure it gets edited into the correct place. Thanks. – Seth Apr 03 '14 at 22:39