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.