Skip to content
Advertisement

How to solve cyclic dependencies while installing software on linux?

I am new to the computing world. My intention is to figure out a generic approach to solve cyclic dependencies while installing new software on Linux, if it exists. Here I am using the case of Google chrome to better illustrate my question. While installing Google chrome (both using package manager and apt-get) I encounter the following problem:

JavaScript

To solve the above error, I tried installing libappindicator1 but that returns another dependency error:

JavaScript

Now here we encounter the cyclic dependency. When trying to install libindicator7 the following error is received:

JavaScript

As you can see that I cannot install the package because of the dependencies. Now one way is to use apt-get -f install and let Linux magically do it’s work. But that won’t teach me much. Using this example (or suggest a better example), can we figure out a better approach to solve the problem of cyclic dependency? If this is a stand-alone case of cyclic dependency while installing a new software or I made a mistake in interpreting the errors then I can remove the question.

Some helpful links-

[1]: https://askubuntu.com/questions/764040/im-having-a-hard-time-installing-google-chrome-on-16-04-lts-please-help [2]: How to solve Cyclic Dependency [3]: How to Solve Circular Dependency [4]: cyclic dependency … how to solve?

Advertisement

Answer

DPKG is the software at the base of the package management system in the free operating system Debian and its numerous derivatives. dpkg is used to install, remove, and provide information about .deb packages. dpkg (Debian Package) itself is a low-level tool. [1]

APT (for Advanced Package Tool) is a set of tools for managing Debian packages, and therefore the applications installed on your Debian system. APT makes it possible to Install applications, Remove applications, Keep your applications up to date and much more.[2]

So if you move step by step on your installation

  1. Once you download a .deb package you can unzip it. Unzip the contained control.tar.gz file. You would find a set of all the required packages.

  2. Find all the dependencies for that specific Debian package. For google-chrome you would have something like

JavaScript
  1. You would need to install all the dependencies for that specific package. Each dependency might depend on a set of other dependencies. You would have a tree of these dependencies. Either you can manually install all these dependencies or use something like apt or yum or aptitude

  2. What either of these package managers would do for you is they would construct a dependency tree for you and install all the relevant packages before installing your Debian package.

So, Ideally there should not be any loops in the dependency tree, but it might be the case that some of the existing packages are already installed and are in newer/older version of what is currently installed and is a required package for an already existing installed package. Then you can end up in cyclic dependency loop.

So, how apt handles cyclic dependencies is mentioned in [3], I think you can consider it as a generic algorithm for solving a dependency manually but it’s not recommended. Circular dependencies happen in the repositories, but the ones left standing to obey some specific rules. Usually, these are tightly bound packages. So the Depends relationship between them specifies the exact version number.

  1. https://en.wikipedia.org/wiki/Dpkg
  2. https://wiki.debian.org/Apt
  3. https://web.archive.org/web/20150905091555/http://algebraicthunk.net/~dburrows/blog/entry/from-blogspot/2005-05-09–21:30:00/
Advertisement