Score:0

Using `apt-get` or `dpkg` install a list of local `.deb` packages, that contains also dependencies

cn flag

I'm receiving a list of .deb from a service (that I don't control) and I want to install or upgrade them in bulk automatically using a script/service.

The list contains the packages and their dependencies but unfortunately is not always in order.

I tried using dpkg -i plus auto-config parameters , with or without --force-depends but it fails immediately, when decompressing process starts, because the dependencies are not already installed or configured even if they are in the list.

Then I tried to use apt-get which installs a part of the packages but for the others returns 0 as exist command status but does nothing.

The packages that I get from the list can exist or not on the machine(there are multiple different machines), I don't have this information, so is install or upgrade.

Ex:

apt-get (or apt) install /local/pkg1_amd64.deb /local/pkg2_amd64.deb /local/pkg3_amd64.deb /local/pkg4_amd64.deb ....

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

It seems that this type of behavior happens usually with packages that need to be upgraded.

I tried different arguments (like -f, -y, --reinstall etc), same result, add debug option to get more verbose the result nothing changes.

Taking in consideration that I have no control on the order of the packages in the list received, and I can only run commands thru a script/service on a machine, what options do I have to fix this problem.

in flag
How do you receive that list and why can’t you edit the order of packages? VMs are a nice way to determine the best order of installation and, if the people supplying the package list take umbrage at your shuffling of the deck chairs, perhaps they would like the responsibility of updating the servers and tending to the consequences of failure?
Joepie Es avatar
eg flag
You can try using 'aptitude' instead of 'apt' and 'apt-get', as this works better with dependencies. If you don't have 'aptitude' installed, install it with ```sudo apt install aptitude```.
user535733 avatar
cn flag
Your output shows `...34 not upgraded.` Solve that problem first before trying to install new packages. Once you are back to installing, show us complete real input and output instead of a sanitized example.
user3541631 avatar
cn flag
I can't manually make changes on the server and install third-party packages(it is an automated system with multiple computers). I received from a service/database a list of ".debs" and I need to pass to another service/script that will install or upgrade(if there are older version installed). | @user535733 - in the list are also packages to upgrade, which ones I don't have the info, can be different on each machine; | Joepie Es I can install only what is receive from the initial service, on the list; | matigo not possible is a complex system with multiple services, like a line of pipes.
user535733 avatar
cn flag
Hmmm. I think your question doesn't have information about your setup.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.