5

I need to install apt package on a Western Digital DL4100 NAS running a Linux DL4100 distribution where the only package system is dpkg. To do so, I have to install multiarch-support, it depends on libc6 which depends on libgcc1. But libgcc1 pre-depends on multiarch-support.

There is no file containing yum, pacman, apt, aptitude, portage, dselect, emerge or zypp in its name on the disc. I have found only dpkg in /var/lib/dpkg and /usr/bin/dpkg.

How can I install these packages where one package depends on another package which pre-depends on the first one?

# dpkg -i /path/to/libc6.deb /path/to/multiarch-support.deb /path/to/libgcc1.deb

returns

dpkg: package libgcc1 pre-depends on multiarch-support, which is not installed or flagged to be installed

There is no package installed under dpkg:

# dpkg -l
    Name           Version
+++-==============-==============
5
  • 2
    dpkg pre-depends on libc6; are you sure libc6 is not already installed? Commented Apr 24, 2016 at 17:34
  • I am sure, it is not installed.
    – 3b-fly
    Commented Apr 24, 2016 at 18:27
  • 1
    How did you end up with a system like that? You say "the only package system is dpkg" — but since dpkg -l doesn't list anything, dpkg isn't actually managing anything on the system... Commented Apr 25, 2016 at 18:30
  • dpkg is the only package manager i have found on disc. So... how can i find out which pm its present. Is kernel 3.10.38 64-bit
    – 3b-fly
    Commented Apr 25, 2016 at 19:36
  • Yes, it is Western Digital NAS DL4100.
    – 3b-fly
    Commented May 13, 2016 at 5:23

4 Answers 4

4

In theory, on a dpkg-managed system, you should be able to install multiple packages in a single operation; this will allow installation of packages with a dependency loop. Assuming you have the appropriate packages downloaded:

dpkg -i libc6_*deb multiarch-support_*deb libgcc1_*deb

will install libc6, multiarch-support and libgcc1.

On a Western Digital NAS though, even if the operating system is based on Debian (there are some indications that it is), installed software isn't managed using dpkg, and fixing that is both quite difficult, and quite likely to break your system further down the line. To install software on your NAS, you should use the features available in MyCloud.

(A dpkg-managed system should never require the above packages to be forcefully installed, since they are dependencies of dpkg itself.)

2
  • No, it will not - see my question.
    – 3b-fly
    Commented May 12, 2016 at 20:06
  • similar issue for me except libgcc1 depends on libc6, this solved the problem ;)
    – Tcll
    Commented Nov 10, 2017 at 22:32
0

You can try to install the packages using some of the --force-... flags of dpkg, use --force-help to list them. The ultimate way is the --force-all flag.

It could be needed that you need to unpack some of the packages manually, and trying the installation again. Having a look at debootstrap, which need to solve the same problem, can also be helpful.

3
  • Using debootstrap here is just a recipe for disaster... It should only be used if you know Debian well enough to attempt to replace the NAS's operating system with it. Commented May 13, 2016 at 21:10
  • @StephenKitt I did not want to suggest using debootstrap, but would suggesting looking in its source code, how it solves the dependency problem.
    – jofel
    Commented May 14, 2016 at 12:34
  • I understand, but trying to solve the dependency problem manually using debootstrap-inspired techniques is also likely to cause problems. This isn't a dpkg-managed system, trying to forcefully turn it into one seems unwise to me. Commented May 14, 2016 at 13:17
0
  1. sudo dpkg --force-all -i <.deb filename>
  2. sudo apt install -f

These two commands worked flawlessly and will work on all softwares.

4
  • The --force- options should not be used lightly. The dpkg man page has this to say of them: "Warning: These options are mostly intended to be used by experts only. Using them without fully under‐standing their effects may break your whole system."
    – JigglyNaga
    Commented Sep 26, 2018 at 13:18
  • but this is the only solution. Commented Oct 24, 2018 at 11:52
  • It is not the only solution: two of the answers to this question don't involve --force at all. However, the downvote was because of the sweeping claim that this "will work on all softwares": How thoroughly did you test it? (The OP specifically mentioned that apt isn't available.) What do you even mean by "softwares" -- packages, or distributions? If the results are "flawless", why is there an emphasized warning against it in the man page?
    – JigglyNaga
    Commented Oct 24, 2018 at 13:19
  • my answer is only for debian based operating systems, and here software means packages, and packages also are software, also I have tested this in which installation I was getting error. Commented Dec 3, 2018 at 13:32
-1

Find a machine where apt-get is installed and run the follow command:

apt-get --print-uris --yes install YourTargetPackage | grep ^\' | cut -d\' -f2 | xargs wget

It will download all dependencies to your machine.

Then you can copy this dependencies on your machine with dpkg-only and download all dependencies:

dpkg -i pathToFolderWithDeps/*

Then install your app:

dpkg -i YourTargetPackage.deb

4
  • Your first command can be greatly simplified using apt-get's --download-only option. But it won't download "all dependencies" to your machine, only those which are missing from the machine it's run on. To retrieve all the dependencies you'd need to use apt-rdepends. Commented May 14, 2016 at 13:20
  • In my case on "proxy" machine all dependencies may by already installed, so we would not get required packages to download. So I have use this long command to be sure that all dependencies will be downloaded. And I try to avoid install extra packages, and apt-rdepends command usually is absent.
    – Sild
    Commented May 14, 2016 at 17:28
  • The long version doesn't change the fact that you won't get all the dependencies... Commented May 14, 2016 at 17:35
  • would the --reinstall flag for apt-get install work?
    – znarf
    Commented Jun 13, 2018 at 6:06

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .