Issue
I was under the impression that depends
/rdepends
relationships between Debian packages constitute a Directed Acyclic Graph (DAG).
However, I just ran into these symmetric rdepends
dependencies between two packages:
apt-cache rdepends libwww-perl # includes libsoap-lite-perl
apt-cache rdepends libsoap-lite-perl # includes libwww-perl
Both packages are installed from stretch/main
. Is this a feature or a bug?
Solution
It is mostly a feature.
It is impossible to have an acyclic graph:
huge number of packages, and no tools to advice about dependencies problem.
There are really cyclic dependencies. By building a distribution from scratch, you will notice it, e.g. now libc requires some external programs (e.g. resolver) and such programs requires libc. One way to solve it was the use of
essential
packages: these construct a core of packages, which could depends each others.it is handy to split library apart of programs, and binaries apart of architecture neutral files (especially if data is huge). This could make cyclic dependency: both parts should be installed together.
Package relation changes and packages changes. So sometime some part is moved into an other package. Cyclic dependencies hide the internal move of API provider.
etc.
Because Debian is not just a single "distribution", but many "distributions" (e.g. 'contrib' and 'non-free', but also 'security', 'backport', 'experimental' etc.) [as Packages.gz lists], additionally sometime we include also external (non-Debian) packages, requiring an acyclic dependence graph could be difficult or just it will block apt, and nobody want that. So I think cyclic dependencies are still a "feature".
Note: sometime the cycles are just "optional". One of the required packages is cyclic, but not all possibilities. 'virtual packages' makes this more difficult.
Answered By - Giacomo Catenazzi