2

My goal is finding ALL reverse-depends of a certain package and the belonging source package. For example, I want all packages that depend on libsslcommon2 and the source package that can be installed via sudo apt-get source libsslcommon2.

From the reverse-depends man page I understand that I need to:

sudo reverse-depends `libsslcommon2`

which works fine. However

sudo reverse-depends src:libsslcommon2

returns

reverse-depends: Error: Unknown package

The same syntax works for src:bash though (as mentioned in the man page).

NB: It works well to install/download the sources for both bash and libsslcommon2 via

sudo apt-get source libsslcommon2
sudo apt-get source bash

What is the problem here? How can I determine all packages that depend on the libsslcommon source package?

3

TL;DR: You can use reverse-depends src:$(what-source libsslcommon2).

There is no libsslcommon2 source package. Instead, libsslcommon2 is one of a number of binary packages built from the qpid-cpp source package. In general, a binary package may or may not have the same name as the source package used to build it, and source packages may provide multiple binary packages.

The name of the source package for bash is also bash, but source package names cannot always be guessed from binary package names.

Two of the ways to check what source package is used to build a binary package are:

  1. Search for the binary package name under "Packages" at https://launchpad.net/ubuntu.
  2. Use the what-source command. (You must install what-utils Install what-utils first. To do that from the command line, run sudo apt-get install what-utils.) For example, what-source libsslcommon2 outputs qpid-cpp.

In practice I usually use Launchpad because it often has other handy information I'm looking for at the same time. But with what-source and reverse-depends, you can write a single command to list the reverse dependencies associated with the source package for a particular binary package:

reverse-depends src:$(what-source libsslcommon2)

This uses command substitution--a $( ) expression is replaced by the output of the command written inside the parentheses.

You may be surprised at the output of that command, which, at least when run from my 15.04 system, is:

No reverse dependencies found

But really this is not so surprising. It means no binary packages except those built from the qpid-cpp source package depend on any binary packages built from the qpid-cpp source package. For example:

ek@Io:~$ reverse-depends libsslcommon2
Reverse-Depends
===============
* libsslcommon2-dev
* qpid-client
* qpidd

Packages without architectures listed are reverse-dependencies in: amd64, arm64, armhf, i386, powerpc, ppc64el
ek@Io:~$ what-source libsslcommon2-dev
qpid-cpp
ek@Io:~$ what-source qpid-client
qpid-cpp
ek@Io:~$ what-source qpidd
qpid-cpp

Finally, take note:

  • You do not need to run reverse-depends (nor what-source) as root. That is, sudo reverse-depends ... is unnecessary; run reverse-depends ... instead.

  • As far as the reverse-depends utility is concerned, a source package's reverse dependencies are the reverse dependencies of the binary packages that are built from the source package. The specific binary package they depend on is listed in parentheses to the right of the package name, in the output of reverse-depends src:....

    The reverse dependencies of a source package, as listed by reverse-depends, are still binary packages, not source packages. For example, the output of reverse-depends src:bash includes:

    * netscript-2.4                 (for bash)
    * netscript-2.4-upstart         (for bash)
    

    This is even though there is no netscript-2.4-upstart source package. Instead, the netscript-2.4 and netscript-2.4-upstart binary packages are both built from the netscript-2.4 source package.

  • The reverse dependencies of a source package are not the same as the reverse build dependencies of a package. The reverse build dependencies of a package are the other packages that require the package in order to be built, but not necessarily to be installed once built. If you're looking for reverse build dependencies, invoke reverse-depends with the -b flag.

  • First of all: Thanks for your great reply! Regarding the sudo: I added it because I got the following error without sudo: Traceback (most recent call last): File "/usr/bin/reverse-depends", line 20, in <module> from distro_info import DistroDataOutdated ImportError: No module named distro_info – langlauf.io Apr 22 '15 at 19:40
  • @stackoverflowwww Hmm... Does reinstalling ubuntu-dev-tools with sudo apt-get --purge --reinstall install ubuntu-dev-tools fix that? – Eliah Kagan Apr 22 '15 at 19:45
  • No, it did not, unfortunately. – langlauf.io Apr 22 '15 at 19:47
  • another strange observation: what-source returns two values for many packages: I tried it for libss-dev, firefox, bash, and some more. For others, e.g. less or sl it returns only one value. For libsslcommon2 what-source returns qpid-cpp only once. Maybe this is due to 32 and 64 bit? – langlauf.io Apr 22 '15 at 19:50
  • @stackoverflowwww On my 15.04 system, what-source libssl-dev outputs only openssl, what-source firefox outputs only firefox, and what-source bash outputs only bash. What kind of output do you get from what-source when it shows two items? – Eliah Kagan Apr 22 '15 at 19:55
2

The reverse-depends software doesn't automatically detect the source package from which a given binary package is generated. The src: label is used to indicate that what follows is the name of a source package. It so happens that the name of the source package for bash is, well, bash. But for libsslcommon2, the source package is named qpid-cpp:

$ reverse-depends -r utopic src:qpid-cpp
Reverse-Depends
===============
* qpidd-msgstore                (for qpidd)
* qpidd-msgstore                (for libqpidbroker2)
* qpidd-msgstore                (for libqpidcommon2)

Packages without architectures listed are reverse-dependencies in: amd64, armhf, i386, ppc64el

apt-get, on the other hand, knows the source packages (check the output of apt-cache show libsslcommon2).

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.