6

My understanding of software dependencies is that a program package may require other packages to be installed, termed dependencies. A tree-like result ensues. Sometimes packages share common dependencies, but the package only needs to be installed once.

                                        |Package D
                  | Package B --------->|
                  |                     |Package E
Package A ------->|
                  |                     |Package F
                  | Package C --------->|
                                        |Package B

I recently posted a question on AskUbuntu.com about finding the dependencies of a package, and all the ways of doing this gave me different results. The reason for this was that some of the methods were apparently listing more than just dependencies, some were performing recursive checks, and some were performing reverse checks.

What is the difference between a reverse dependency check, and a recursive dependency check?

EDIT:

Citations for terms. I first heard them in the comments of a thread I posted about APT, but they are used in several programs that can be used to do dependency checks as well as on their manpages.

apt-cache rdepends is looking for Reverse dependencies, my script and apt-rdepends are recursively looking for dependencies.
rdepends pkg(s)
           rdepends shows a listing of each reverse dependency a package has.
apt-rdepends - performs recursive dependency listings similar to
       apt-cache
  • Can you cite where those 2 terms were being used? – slm Jul 8 '14 at 5:26
  • @slm I've given a few. – please delete me Jul 8 '14 at 6:03
12

Reverse depends

Reverse depends means you want a list of packages that depend on a given package.

Example

$ apt-cache rdepends jetty
jetty
Reverse Depends:
  solr-jetty
  libjetty-java
  libjetty-extra-java
  libjetty-extra
  libini4j-java
  guacamole

Recursive depends

Using a tool such as apt-rdepends shows what packages a given package is dependent on, plus what packages these packages are also dependent on. This is performed recursively until the entire dependency tree is exhausted.

Example

$ apt-rdepends jetty | head -10
Reading package lists... Done
Building dependency tree       
Reading state information... Done
jetty
  Depends: adduser
  Depends: apache2-utils
  Depends: default-jre-headless
  Depends: java5-runtime-headless
  Depends: jsvc
  Depends: libjetty-java (>= 6.1.26-1ubuntu1)
adduser
  Depends: debconf
  Depends: debconf-2.0
...

Above you can see that jetty is dependent on adduser which itself is dependent on debconf.

Reverse recursive depends

This one shows what packages depend on a package that depends on a given package. This is again done recursively.

Example

$ apt-rdepends --reverse jetty 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
jetty
  Reverse Depends: solr-jetty (>= 3.6.1+dfsg-0ubuntu2)
solr-jetty
  Reverse Depends: chef-solr (>= 10.12.0+dfsg-1)
chef-solr
  Reverse Depends: chef-expander (>= 10.12.0-1)
  Reverse Depends: chef-server-api (>= 10.12.0-1)
chef-expander
chef-server-api
  Reverse Depends: chef-server-webui (>= 10.12.0+dfsg-1)
chef-server-webui

Again here as the tree is explored the first package that lists jetty as a dependency is solr-jetty, which in turn is listed as a dependency for chef-solr, etc.

Types of depends

It can get a little confusing but there are a variety of depends. Looking at the man page for apt-rdepends:

   -f, --follow=DEPENDS
        A comma-separated list of DEPENDS types to follow recursively. 
        By default, it only follows the Depends and PreDepends types.

        The possible values for DEPENDS are: Depends, PreDepends, Suggests,
        Recommends, Conflicts, Replaces, and Obsoletes.

        In --build-depends mode, the possible values are: Build-Depends, 
        Build-Depends-Indep, Build-Conflicts, Build-Conflicts-Indep.
  • once again awesomness in a tube – Kiwy Jul 8 '14 at 7:15
  • What does "predepends" mean? And how is it different from "reverse depends"? – CMCDragonkai Sep 21 '15 at 4:57
  • please ask that as a separate question, I would be interested to know about it as well. – shirish May 27 '18 at 1:19

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.