역 의존 : 소스 패키지의 역 의존성 찾기


2

제 목표는 특정 패키지와 해당 소스 패키지의 모든 역 의존성을 찾는 것입니다.예를 들어 libsslcommon2에 의존하는 모든 패키지와 sudo apt-get source libsslcommon2을 통해 설치할 수있는 소스 패키지를 원합니다.

reverse-depends man page부터 다음 사항을 이해해야합니다.

sudo reverse-depends `libsslcommon2`

잘 작동합니다.그러나

sudo reverse-depends src:libsslcommon2

반환

reverse-depends: Error: Unknown package

src:bash에 대해 동일한 구문이 작동합니다 (man 페이지에서 언급 한 바와 같이).

NB : bash와 libsslcommon2를위한 소스를 설치 / 다운로드하는 것이 좋습니다

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

여기에 무슨 문제가 있습니까?libsslcommon 소스 패키지에 의존하는 모든 패키지를 어떻게 확인할 수 있습니까?

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).


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:

[email protected]:~$ reverse-depends libsslcommon2
Reverse-Depends
===============
* libsslcommon2-dev
* qpid-client
* qpidd

Packages without architectures listed are reverse-dependencies in: amd64, arm64, armhf, i386, powerpc, ppc64el
[email protected]:~$ what-source libsslcommon2-dev
qpid-cpp
[email protected]:~$ what-source qpid-client
qpid-cpp
[email protected]:~$ 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.