SEARCH

Enter your search query in the box above ^, or use the forum search tool.

You are not logged in.

#1 2014-05-02 06:19:20

Peniblec
New Member
Registered: 2012-07-06
Posts: 8

Install packages, manage dependencies without Internet access

Hi all,

I just installed a fresh Waldorf on a desktop without Internet access. I'm trying to figure out how to work around dependencies problems when installing new packages.

Previously I was working with a Xubuntu 10.04 VM, and what I did when I needed some software was:

  1. go to packages.ubuntu.com with a second desktop (one with Internet access)

  2. download the .deb for that software, as well as the .deb for each of its dependencies

  3. run

    dpkg-scanpackages <download dir> /dev/null | gzip -9c > Packages.gz
  4. transfer that folder (e.g. via USB key) into <some folder> on the first desktop

  5. run

    apt-get update

    on that first desktop (<some folder> figures in my /etc/apt/sources.list)

  6. run

    apt-get install <package I actually need>
  7. if I met any dependencies problems (i.e. some package from packages.ubuntu.com needs a newer version of a package that's already installed), go to launchpad.net and download an older version of that .deb

Now with Waldorf so far I used packages.debian.org, but trying to install openjdk-6-jre and its dependencies, apt choked on the following packages:

tzdata-java : Depends: tzdata (= 2014a-0wheezy1) but 2013b-2 is installed.
libnss3-1d : Depends: libnss3 (= 2:3.14.5-1) but 2:3.14.3-1 is installed.

With Xubuntu, I'd just have gone to launchpad.net, found the older .deb and tried again, but here I'm not sure. Since Ubuntu is Debian-based, I guess I could find those older packages on launchpad.net, but I figured this would be a good time to actually think about my method and see if there's some cleaner way to manage packages and dependencies on a computer with no Internet access.

So yeah, if the method I described seems horribly dumb, it's probably because it is... And I'm willing to be taught how wrong I am :p

Offline

Help fund CrunchBang, donate to the project!

#2 2014-05-02 06:22:02

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 3,727

Re: Install packages, manage dependencies without Internet access

Why don't you get a newer version of the packages you need from Debian?


Artwork at deviantArt;  Iceweasel Personas;  SLiM #! Themes;  Openbox themes

Offline

#3 2014-05-02 07:34:19

Peniblec
New Member
Registered: 2012-07-06
Posts: 8

Re: Install packages, manage dependencies without Internet access

And then run apt-get update && apt-get upgrade? I've thought about that. I guess that could work (and actually be better from a security standpoint). I guess I did not want to try that because the amount of dependencies to fetch for one software is finite, while the amount of packages to upgrade when one starts needing an upgrade is... Well, I guess it's finite too, I'm just afraid I'll end up downloading the whole website.

Seriously though, this sounds like a good approach. Now before doing that (actually I won't have access to the computer before Monday, that's why I'm just sitting there pondering rather than actually doing something), say I have two entries in my /etc/apt/sources.list, one for this folder where I copy stuff I downloaded on another computer, and one for the LiveCD on which I can find some packages.

If the folder has newer versions of packages that are also available (but older) on the CD, and I run apt-get upgrade, is apt going to go "Oh hey this folder has newer versions of packages I have installed, might as well install them", or will it go "Woah hey wait I have two versions of the same packages what the heck should I do with those" ?

Offline

#4 2014-05-02 13:46:53

ohnonot
...again
Registered: 2012-05-22
Posts: 1,539
Website

Re: Install packages, manage dependencies without Internet access

Peniblec, your approach seems overly complicated.
why don't you just install the .deb's with dpkg or gdebi?
of course you have to start with the dependencies.

you should also know that crunchbang is based on debian stable.
it is, as the name says, rather stable, but some apps are using old versions.

there is also debian testing and unstable; i think ubuntu was originally based on debian testing, but has morphed far away from it. do not use ubuntu packages.

if you are trying to install an application with a higher version than what is in stable, you are likely to go into "dependency hell".
there are ways around that, but if you don't necessarily need that newest version, it's better to install an older version.

basically, installing apps offline is no different than online, you just have to provide your system with everything it asks for.

i would remove your additions to /etc/apt/sources.list and just install the packages "manually" with dpkg -i or gdebi.

you can search packages.debian only for packages in stable, which is wheezy iirc, and it also lists all dependencies for a certain package, with links, so you can download everything very conveniently, then move it to your other computer and install.
i have done that myself many times.

Last edited by ohnonot (2014-05-02 13:50:19)

Offline

#5 2014-05-02 14:52:22

Alad
Software Satan
Registered: 2014-02-20
Posts: 1,274

Re: Install packages, manage dependencies without Internet access

i would remove your additions to /etc/apt/sources.list and just install the packages "manually" with dpkg -i or gdebi.

Yep, gdebi. Gdebi solves dependencies, dpkg doesn't ... so work your way down until it installs.

Offline

#6 2014-05-02 15:13:54

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,990
Website

Re: Install packages, manage dependencies without Internet access

There's a package called apt-offline which is meant for this situation:
https://packages.debian.org/wheezy/apt-offline
Here's a bit of explanation:
http://docs.xubuntu.org/1204/offline-packages.html


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#7 2014-05-02 17:21:01

Peniblec
New Member
Registered: 2012-07-06
Posts: 8

Re: Install packages, manage dependencies without Internet access

@ohnonot:
I actually started using dpkg -i, basically the same way I'm using apt-get now, until I found this "add local folder to sources.list" trick. It does seem overly complicated, but I figured it looked "cleaner" somehow. Probably isn't.

The problem even with stable .deb's on packages.debian is that some of them need newer versions of packages already installed on the system. For example, take this package, it's wheezy, it's stable, yet it needs tzdata (= 2014a-0wheezy1). On a fresh Waldorf install, 2013b-2 is installed. So it's not me wanting the newest version, it's just the stable packages from the website being newer than those on a LiveCD from 2013 smile

Thanks for the suggestions, I'll have a look on Monday and let you know how it went.

Offline

#8 2014-05-02 17:29:24

damo
#! gimpbanger
From: N51.5 W002.8 (mostly)
Registered: 2011-11-24
Posts: 3,727

Re: Install packages, manage dependencies without Internet access

@OP

Don't forget that some packages come from the crunchbang repo, and may have older versions than what is now available from wheezy/stable


Artwork at deviantArt;  Iceweasel Personas;  SLiM #! Themes;  Openbox themes

Offline

#9 2014-05-03 07:01:32

ohnonot
...again
Registered: 2012-05-22
Posts: 1,539
Website

Re: Install packages, manage dependencies without Internet access

Peniblec wrote:

The problem even with stable .deb's on packages.debian is that some of them need newer versions of packages already installed on the system. For example, take this package, it's wheezy, it's stable, yet it needs tzdata (= 2014a-0wheezy1). On a fresh Waldorf install, 2013b-2 is installed. So it's not me wanting the newest version, it's just the stable packages from the website being newer than those on a LiveCD from 2013

yes.
of course you have to update your linux operating system after you install, and before you install anything else.
have you done that at all before this whole rigmarole started?
oh i forgot you haven't got internet access...

in that case (and if there's no way to hook the machine to the net even temporarily) the rigmarole is your only choice.
as alad said earlier: "Yep, gdebi. Gdebi solves dependencies, dpkg doesn't ... so work your way down until it installs."

anyhow, i have 100% trust in how debian deducts dependencies on their branches, so if apt says that's the dependency, then that is the dependency and it is also possible to install it. and the packages.debian sites are an exact mirror of how apt works.

debian don't maintain their wiki's very well, but they do maintain packages.

Last edited by ohnonot (2014-05-03 07:04:07)

Offline

#10 2014-05-03 12:14:38

johnraff
nullglob
From: Nagoya, Japan
Registered: 2009-01-07
Posts: 2,990
Website

Re: Install packages, manage dependencies without Internet access

ohnonot wrote:

you have to update your linux operating system after you install, and before you install anything else.
have you done that at all before this whole rigmarole started?
oh i forgot you haven't got internet access...

in that case (and if there's no way to hook the machine to the net even temporarily) the rigmarole is your only choice.

...to repeat, apt-offline is made to do this. I've used it myself to upgrade the system then install more packages on a box that was out in the sticks, totally offline. It needs two or three back-and-forth trips with usb sticks, but it's quite easy - check that tutorial. smile


John
--------------------
( a boring Japan blog , idle twitterings  and GitStuff )
#! forum moderator

Offline

#11 2014-05-05 20:05:23

Peniblec
New Member
Registered: 2012-07-06
Posts: 8

Re: Install packages, manage dependencies without Internet access

Thanks for your answers. I took a quick look at apt-offline but I assumed (wrongly) that I needed a second Linux with Internet access to process the signature generated by my disconnected PC. I only found out just now that it also runs on Windows; I'll be sure to try when I run into deeper dependencies-related problems.

For now I've simply downloaded the newer version of the outdated packages and run apt-get upgrade ; turns out those two packages could be updated without running into Dependency Hell.

Again, thanks for your advices!

Offline

#12 2014-05-06 06:21:41

ohnonot
...again
Registered: 2012-05-22
Posts: 1,539
Website

Re: Install packages, manage dependencies without Internet access

i'm a bit confused about your private message.

did you manage to update your system (with apt-offline)?
further, did you solve your original problem?

although i am not in the same situation, this would be an important piece of information.

Offline

#13 2014-05-06 19:54:30

Peniblec
New Member
Registered: 2012-07-06
Posts: 8

Re: Install packages, manage dependencies without Internet access

Sorry if I wasn't clear. What I actually did was closer to what damo suggested in this thread's first reply: (the "solution" begins at 6., everything before is a recall of the situation before you guys came to the rescue)

  1. I needed openjdk-6-jre, so I went to packages.debian.org with a second computer running Windows, found the stable (wheezy) version, and I downloaded the .deb;

    • for all the dependencies displayed on the web page, I ran "apt-get install" on the disconnected computer: if it failed to install/was not already installed, I downloaded the .deb from the website;

    • (did that recursively for all dependencies)

  2. I transferred everything via USB key to <some folder> on the disconnected computer;

    • (<some folder> figures in /etc/apt/sources.list)

    • (also ran "dpkg-scanpackages | gzip" on <some folder>)

  3. I ran "apt-get update ; apt-get install openjdk-6-jre";

  4. Cue the apt error I reported in my first post, and me being stuck;

  5. I looked at apt-offline, focused on how it works, missed that it also worked on Windows;

  6. I returned to packages.debian.org and downloaded the stable version for the two packages apt was complaining about;

    • (repeat USB transfer/dpkg-scanpackages)

    • (cue me crossing fingers hoping not to run into Dep Hell)

  7. I ran "apt-get update && apt-get upgrade": apt recognized the downloaded .deb's as being newer and upgraded the packages, no questions asked, no outdated dependencies;

  8. I ran "apt-get install openjdk-6-jre", everything installed flawlessly;

  9. I started replying to this thread and stopped when I tried to justify not using apt-offline;

  10. I looked at apt-offline some more and felt somewhat stupid.

Last edited by Peniblec (2014-05-06 19:57:25)

Offline

#14 2014-05-07 06:04:27

ohnonot
...again
Registered: 2012-05-22
Posts: 1,539
Website

Re: Install packages, manage dependencies without Internet access

thanks for this.
since i have never used apt-offline, i can't help.
have how about "man apt-offline" or some documentation that came with it (usually in /usr/doc)?

Offline

Board footer

Powered by FluxBB

Copyright © 2012 CrunchBang Linux.
Proudly powered by Debian. Hosted by Linode.
Debian is a registered trademark of Software in the Public Interest, Inc.

Debian Logo