How can I use gdebi with wildcard args correctly?

Asked by Steve Rainwater

When I have a directory full of deb packages to install and I try "gdebi --n /path/*.deb" it installs the first package only and then stops. I can't find a clear explanation in the man page for how to force it to continue to the rest of the packages. What is the correct set of arguments to install all deb packages?

For background, I'm transitioning a project from CentOS to Ubuntu and need to find an Ubuntu utility that has roughly the equivalent of rpm's basic package handling functions. On CentOS or RHEL, we use the command "rpm /path/*.rpm" and it will solve all dependencies and install the packages in the correct order. We initially tried "dpkg /path/*.deb" but it invariably fails with errors as it's not able to solve dependencies or get the install order correct. We looked into using apt but it requires either an internet connection or a special repo; it doesn't seem able to work on an air-gapped server with a directory containing deb packages. Several answers on Stackexchange recommended we try gdebi as it is more capable than dpkg but so far I think I'm not understanding what command line args to use to get gdebi to work correctly in this context.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu gdebi Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

You might try something like

ls /path/*.deb | xargs gdebi

Another option could be to use dpkg with the --force-depends flag which install the packages without caring for the dependencies (and leaving behind a broken package management system), and afterwards installing the missing dependencies with "apt install -f"

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#2

Why gdebi? Could use dpkg or apt in the terminal.

sudo dpkg -i /pth/to/*.deb; sudo apt -f install

Done

Revision history for this message
Steve Rainwater (steevithak) said :
#3

Thanks for the suggestions, I tried:

dpkg -i --force-depends /path/*.deb; apt -f install

The dpkg command produced several error messages, which I expected.

The apt -f install didn't appear to do anything, the only output was:

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

I'm assuming apt isn't going be able to do anything without an Internet connection? Or did it fix the breakage from dpkg and just not generate any output about what it's doing? Is there a --verbose flag for apt that might give more info on what it fixed (or didn't fix)?

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

Without seeing the error messages from dpkg it is not possible to judge what dpkg did (or hasn't done).

If you don't have an internet connection, how do you expect that gdebi can resolve the dependencies by downloading and installing the missing packages?

The output of apt indicates, that there are no missing packages.

You can check the status of the package management system dependencies with the command

sudo dpkg --audit

Revision history for this message
Steve Rainwater (steevithak) said :
#5

As I indicated in my original question, the whole point of what I'm doing is to get a local directory of deb packages installed on an air-gapped server with no Internet connection. All necessary deb packages, including all dependencies, are present in the directory. I'm just looking for a method of installing them with a single command that will correctly resolve the dependencies and install in the correct order. After trying apt and dpkg unsuccessfully, I found recommendations on a stackexchange question suggesting gdebi might be able to do a wildcard install of a directory of packages, that's the only reason I was trying it.

Thanks, I tried "dpkg --audit" but it doesn't produce any output at all - no indication that things are ok or have errors, just nothing. Maybe I'm using it wrong. I'll try google. In any case it looks like gdebi isn't what I need, so I'll move on. But thanks for the replies, I appreciate everyone's suggestions!

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

If you have all packages available that resolve the dependencies, then dpkg -i *.deb should install them without complaints. If there still are error messages from dpkg, then they should be investigated (eventually in a first step some packages need to be installed that are pre-requisites for starting the install of other ones). You might consider running the dpkg command twice or three times; does dpkg still show errors when re-run?

It seems that gdebi does not allow wildcards in the package name, but needs that all packages are listed separately. This is why I suggested listing all packages with "ls" and piping the output into xargs for gdebi. Have you tried that?

As far as I can remember, synaptic has a function to install all deb files from within a directory, but being a graphical program it most probably is not what you want for a server. Eventually aptitude allows wildcards, I never tried it.

You have to be aware, that apt manages a list of available packages (by apt update) that is then used for identifying eventually required additional packages that have to be downloaded. Without internet connection you will be missing that package inventory. I do not know, whether other programs work the same and also use that inventory. In case that gedbi does that (it definitely depends on parts of apt), then it will not be possible to successfully use gdebi without internet connection either.

Can you help with this problem?

Provide an answer of your own, or ask Steve Rainwater for more information if necessary.

To post a message you must log in.