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


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
  • 2
    dpkg pre-depends on libc6; are you sure libc6 is not already installed? – Stephen Kitt Apr 24 '16 at 17:34
  • I am sure, it is not installed. – 3b-fly Apr 24 '16 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... – Stephen Kitt Apr 25 '16 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 Apr 25 '16 at 19:36
  • Yes, it is Western Digital NAS DL4100. – 3b-fly May 13 '16 at 5:23

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.)

|improve this answer|||||
  • No, it will not - see my question. – 3b-fly May 12 '16 at 20:06
  • similar issue for me except libgcc1 depends on libc6, this solved the problem ;) – Tcll Nov 10 '17 at 22:32

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.

|improve this answer|||||
  • 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. – Stephen Kitt May 13 '16 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 May 14 '16 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. – Stephen Kitt May 14 '16 at 13:17
  1. sudo dpkg --force-all -i <.deb filename>
  2. sudo apt install -f

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

|improve this answer|||||
  • 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 Sep 26 '18 at 13:18
  • but this is the only solution. – Prakash Lakhara Oct 24 '18 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 Oct 24 '18 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. – Prakash Lakhara Dec 3 '18 at 13:32

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

|improve this answer|||||
  • 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. – Stephen Kitt May 14 '16 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 May 14 '16 at 17:28
  • The long version doesn't change the fact that you won't get all the dependencies... – Stephen Kitt May 14 '16 at 17:35
  • would the --reinstall flag for apt-get install work? – hnzjo Jun 13 '18 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.