Collection
zero Useful+1
zero

Dependency Hell

Problems caused by the unsatisfied dependencies between software in the operating system
Dependency hell (English: Dependency hell) refers to the problems caused by the unsatisfied dependencies between software in the operating system.
Chinese name
Dependency Hell
Foreign name
Dependency hell

brief introduction

Announce
edit
Dependency Hell (English: Dependency hell ), refers to the problems caused by the unsatisfied dependencies between software in the operating system.
A software package depends on other necessary software packages (and the version must meet the requirements), which makes the software package system form a complex dependency network and may cause a series of problems. Some software packages may need to install a large number of software packages because of their dependency; On the other hand, the uninstallation of a software package may cause a large number of software packages to fail to work.
At present, GNU/Linux Through the advanced software package management mechanism, the dependency hell problem has been solved to a certain extent. The more famous ones are Debian Camp APT and Redhat Camp Yum [1]

Origin of the problem

Announce
edit
Compared with the "starting afresh" approach, modern software often uses some existing components (such as libraries, programs, multimedia files) for development. These components may be some software or designed for other software( library )。 Program developers design their own software according to specific versions of components. This method reduces the workload of development and makes the program relatively light. However, in order for the software to run correctly, some components of the specified version must be installed.
Let's make a metaphor: you are building a house without producing doors and windows. Because the size of the door opening and window should match the size of the door and window, you have to find a door and window manufacturer to build a suitable house with their doors and windows as the standard. The house you build must depend on the specific type of door produced by this door and window manufacturer.
This is the process of dependence.
If there is only simple dependency, it is easier to solve. For example, software A depends on the e and z software packages, while the e and z software packages do not. You only need to install the e and z software packages, and then install software A. It is as simple and clear as the dependence between the builder and the door and window operator.
However, when there are too many dependencies, with multi-level structure, forming an intricate network, the resolution of dependencies will become extremely difficult, and even fatal errors that cannot be resolved will occur.
Because software packages update rapidly and are not synchronized with each other, the version conditions required by dependencies may not exist soon.
When multiple software packages depend on one software package at the same time, but the required versions are different. If software package A depends on gcc-4.6 and above and software package B depends on gcc-4.5, dependency conflicts will occur. In this case, two software packages A and B cannot meet the dependency at the same time, and cannot be installed or run at the same time.
When a software package depends on multiple software packages, the difficulty of resolving dependencies will increase. For example, Package A depends on 40 software packages, and each of these 40 software packages has its own dependency relationship, which can be as deep as 3-5 layers. Such calculations are sometimes difficult to complete by manpower, and must be automatically analyzed with the help of the package manager. At the same time, the number of installed components will also increase due to excessive dependencies.
When two software packages do not coexist, it may have a huge impact on the whole system. If there are two underlying software packages, the impact will be greater. The network formed by dependency will break into two parts that do not coexist. In the process of building the software package system, try to avoid this situation, especially the non coexistence of the underlying software packages.
In special cases, unsolvable dependencies may also occur, such as dependency loops. [2]

Problem type

Announce
edit

Too many dependencies

A software package may depend on many libraries, so you need to install several or even dozens of library packages when installing a software package.

Multiple dependency

There are too many levels from the required package to the lowest level package. This will cause dependency resolution to be too complex and prone to dependency conflicts and circular dependencies.

Dependency conflict

That is, two software packages cannot coexist. In addition to the direct conflict between the contents of two software packages, it is also possible that the low-level software packages they depend on conflict with each other. Therefore, two seemingly unrelated software packages may not be installed due to dependency conflicts.

Dependency loop

That is, the dependency relationship forms a closed loop, which ultimately leads to the installation of A, B, C, and D packages before installing A packages. However, this is impossible. [1]