LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   Fix APT with `apt-get -f install` without internet access? (https://www.linuxquestions.org/questions/debian-26/fix-apt-with-%60apt-get-f-install%60-without-internet-access-4175524519/)

notKlaatu 11-06-2014 01:52 AM

Fix APT with `apt-get -f install` without internet access?
 
I am maintaining computers at a site with no internet.

To install new applications, I used Synaptic > File > Generate Script, which gave me a list of dependencies; I downloaded those, put them on a drive, took them to the site.

I tried to install the packages with just a
Code:

dpkg -i *deb
...thinking that since they were binary installs, dpkg would install regardless of dependency resolution; that didn't happen, and it seems to have screwed things up badly enough that I cannot install anything.

It says I need to do a

Code:

apt-get -f install
to repair, but when I do this, it complains that it cannot fetch packages.

So I do

Code:

apt-get -f purge
but it complains that it cannot fetch packages.


I'm assuming there's some way that I'm just not seeing to clear out whatever packages are clogging up this system without actually having access to the internet. I'm just not getting what it is. The man page suggests a few things, but so far everything seems to want to have internet access, even though all I'm trying to do is remove packages.

What am I overlooking?

evo2 11-06-2014 02:46 AM

Hi Klaatu,

apt assumes network contectivity, dpkg does not. So, have you tried using dpkg to remove problematic packages? Eg
Code:

dpkg --purge some-package
If you have packages only partially installed, Ie unpacked but not configured you can use:
Code:

dpkg --configure --pending
HTH,

Evo2.

notKlaatu 11-06-2014 12:08 PM

OK, that makes sense. Thanks, I'll give it a shot this weekend and report back / mark this thread solved as applicable.

jens 11-08-2014 07:03 AM

Instead of --pending, you can also use -a (--all):
Code:

dpkg --configure -a
... both should end up doing the same (--configure avoids packages that are marked as successfully configured).

Use dpkg-reconfigure to (re)configure "already configured" packages.
Code:

dpkg-reconfigure -a
... will reconfigure all packages.

EDDY1 11-09-2014 12:52 AM

I just tether my cell phone to get an internet connection when in a pinch.

sgosnell 11-09-2014 08:48 AM

Yabbut, if the equipment has no wifi capability, tethering can be rather difficult. Worse if it has no ethernet ports.

notKlaatu 11-09-2014 02:20 PM

Quote:

Originally Posted by jens (Post 5266615)
Instead of --pending, you can also use -a (--all):
Code:

dpkg --configure -a
... both should end up doing the same (--configure avoids packages that are marked as successfully configured).

Use dpkg-reconfigure to (re)configure "already configured" packages.
Code:

dpkg-reconfigure -a
... will reconfigure all packages.

The dpkg commands suggested in this thread were successful. Sometimes it took one or the other, or both, sometimes manual one-by-one uninstalls of certain packages were required, but it all worked out in the end.

It seems to me that dpkg should not really be concerned with deps if I am installing a binary .deb package. Copy the files to the system, warn me that deps have not been satisfied, and let me install the separately. To put the APT database into an unusable state just because a few packages are missing dependencies (which I intended to manually satisfy) seems like a bad policy to me.

Is there a better way to do offline manual installs of deb packages, aside from dpkg?

Or am I just trying to treat this too much like Slackware, and need to just get into the rhythm of how Debian does things? It's ok if that is the case, but I guess my ideal solution would be something that just lets me install deb packages (which I have pre-downloaded, deps inclusive) without regard to deps, trusting that I know enough to install the deps.

tldr:
Is there a way to install binary packages on Debian out of the sequence defined by their hierarchy of dependencies?

EDDY1 11-09-2014 03:04 PM

Quote:

Originally Posted by sgosnell (Post 5267124)
Yabbut, if the equipment has no wifi capability, tethering can be rather difficult. Worse if it has no ethernet ports.

Tethering with phone is done by usb connection but treated as ethernet. Most phones today just have to be enabled in the phone settings. As far as the connection it's established upon boot, if not just enter
Code:

dhclient eth0

notKlaatu 11-09-2014 03:39 PM

Quote:

Originally Posted by EDDY1 (Post 5267255)
Tethering with phone is done by usb connection but treated as ethernet. Most phones today just have to be enabled in the phone settings. As far as the connection it's established upon boot, if not just enter
Code:

dhclient eth0

Tethering with a phone is not an option, as I have no cell phone.

andre@home 11-09-2014 04:53 PM

Read this disccusion, usefull suggestions were made:
http://stackoverflow.com/questions/1...net-connection

There are more of such discussions running in the out side world.
https://www.google.nl/webhp?sourceid...ernet%20access

notKlaatu 11-09-2014 05:03 PM

Quote:

Originally Posted by andre@home (Post 5267282)
Read this disccusion, usefull suggestions were made:
http://stackoverflow.com/questions/1...net-connection

There are more of such discussions running in the out side world.
https://www.google.nl/webhp?sourceid...ernet%20access

Thanks. I get the picture I think. build-deps sounds like the missing piece of the puzzle, although I still think it's a bit clunky since apparently it will require removal of pre-existing deps. I will figure out the best combo and script something that makes it more or less simple.

Thanks everyone for the suggestions. Marking this thread as solved.

evo2 11-09-2014 07:36 PM

Hi Klaatu,
Quote:

Originally Posted by notKlaatu (Post 5267244)
It seems to me that dpkg should not really be concerned with deps if I am installing a binary .deb package. Copy the files to the system, warn me that deps have not been satisfied, and let me install the separately. To put the APT database into an unusable state just because a few packages are missing dependencies (which I intended to manually satisfy) seems like a bad policy to me.

Debian works very hard to try to ensure there are no broken dependencies. If you really want to you can force it to break the dependencies by using the command line options to dpkg, but if you are resorting to this you've probably missed something or made a "mistake" in your approach to solving the problem.

Quote:

Originally Posted by notKlaatu (Post 5267244)
Is there a better way to do offline manual installs of deb packages, aside from dpkg?

If you have all the required packages you can install them in one go with dpkg.
Code:

dpkg -i *.deb
If this is something you will need to do on a regular basis then I suggest you look into using something like apt-offline.

Quote:

Originally Posted by notKlaatu (Post 5267244)
Or am I just trying to treat this too much like Slackware, and need to just get into the rhythm of how Debian does things?

I think this may be the case.

Quote:

Originally Posted by notKlaatu (Post 5267244)
It's ok if that is the case, but I guess my ideal solution would be something that just lets me install deb packages (which I have pre-downloaded, deps inclusive) without regard to deps, trusting that I know enough to install the deps.

See above.
Quote:

Originally Posted by notKlaatu (Post 5267244)
tldr:
Is there a way to install binary packages on Debian out of the sequence defined by their hierarchy of dependencies?

Short answer: Yes, there is (flags given in dpkg man page), but no, you probably shouldn't do it.

HTH,

Evo2.

k3lt01 11-09-2014 08:09 PM

Quote:

Originally Posted by evo2 (Post 5265409)
apt assumes network contectivity, dpkg does not.

apt does not require network connectivity for it to work, you can use CD/DVD media or even a portable (flash/Hard) drive with a repository on it.
Once you have that all sorted you just place it in the sources.list and you're done.

evo2 11-09-2014 08:15 PM

Hi,
Quote:

Originally Posted by k3lt01 (Post 5267338)
apt does not require network connectivity for it to work, you can use CD/DVD media or even a portable (flash/Hard) drive with a repository on it.

True. I guess what I should have said was more along the lines of "access to a repository".

Cheers,

Evo2.

EDDY1 11-09-2014 09:21 PM

If the machines are off line, have they been upgraded at all?
If the machines haven't been upgraded are you putting new packages or are they from the old repo's


All times are GMT -5. The time now is 09:06 PM.