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?


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
  • Can you cite where those 2 terms were being used?
    – slm
    Commented Jul 8, 2014 at 5:26
  • @slm I've given a few. Commented Jul 8, 2014 at 6:03

1 Answer 1


Reverse depends

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


$ apt-cache rdepends jetty
Reverse Depends:

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.


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


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

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
    Commented Jul 8, 2014 at 7:15
  • What does "predepends" mean? And how is it different from "reverse depends"? Commented Sep 21, 2015 at 4:57
  • please ask that as a separate question, I would be interested to know about it as well.
    – shirish
    Commented May 27, 2018 at 1:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .