Checking Package Dependencies with apt-rdepends on Debian and Ubuntu

This short guide shows how you can check the dependencies of a package with the tool apt-rdepends on Debian and Ubuntu systems. The great thing about apt- rdepends is that it resolves dependencies recursively, i.e., not only does it show the direct dependencies of a package, but also the dependencies' dependencies. This is great, for example, if you want to rebuild a package from the sources, etc.

Installing apt-rdepends

In order to install apt-rdepends, we simply run on Debian

apt-get install apt-rdepends

or this command on Ubuntu

sudo apt-get install apt-rdepends

Afterwards, we can use it to resolve dependencies. To learn more about its usage, take a look at

man apt-rdepends

Or use the --help commandline option.

[email protected]:~# apt-rdepends --help
Usage:
apt-rdepends [options] [pkgs ...]

Options:
-b, --build-depends show build dependencies
-d, --dotty generates a dotty graph
-p, --print-state show the state of each dependency
-r, --reverse list packages that depend on the specified one
-f, --follow=DEPENDS only follow DEPENDS dependencies recursively
-s, --show=DEPENDS only show DEPENDS dependencies
--state-follow=STATES only follow STATES states recursively
--state-show=STATES only show STATES states
--help display this help and exit
--man display the man page and exit
--version output version information and exit

Using apt-rdepends

Usually, you just use it with a package name, e.g. apt-rdepends package. For example, to check the dependencies of the package libapache2-mod-php7.0, we run

apt-rdepends libapache2-mod-php7.0

Here's a sample output from a Debian 9 system:

[email protected]:~# apt-rdepends libapache2-mod-php7.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
libapache2-mod-php7.0
Depends: apache2-api-20120211
Depends: apache2-bin (>= 2.4.16)
Depends: libc6 (>= 2.15)
Depends: libmagic1
Depends: libpcre3 (>= 1:8.20)
Depends: libssl1.1 (>= 1.1.0)
Depends: libxml2 (>= 2.8.0)
Depends: mime-support
Depends: php7.0-cli
Depends: php7.0-common (= 7.0.27-0+deb9u1)
Depends: php7.0-json
Depends: php7.0-opcache
Depends: tzdata
Depends: ucf
Depends: zlib1g (>= 1:1.1.4)
apache2-api-20120211
apache2-bin
Depends: libapr1 (>= 1.5.0)
Depends: libaprutil1 (>= 1.5.0)
Depends: libaprutil1-dbd-freetds
Depends: libaprutil1-dbd-mysql
Depends: libaprutil1-dbd-odbc
Depends: libaprutil1-dbd-pgsql
Depends: libaprutil1-dbd-sqlite3
Depends: libaprutil1-ldap
Depends: libc6 (>= 2.14)
Depends: libldap-2.4-2 (>= 2.4.7)
Depends: liblua5.2-0
Depends: libnghttp2-14 (>= 1.14.0)
Depends: libpcre3
Depends: libssl1.0.2 (>= 1.0.2d)
Depends: libxml2 (>= 2.7.4)
Depends: perl:any
Depends: zlib1g (>= 1:1.1.4)
libapr1
Depends: libc6 (>= 2.15)
Depends: libuuid1 (>= 2.16)
libc6
Depends: libgcc1
libgcc1
Depends: gcc-6-base (= 6.3.0-18+deb9u1)
Depends: libc6 (>= 2.14)
gcc-6-base
libuuid1
Depends: libc6 (>= 2.4)
Depends: passwd
passwd
Depends: libaudit1 (>= 1:2.2.1)
Depends: libc6 (>= 2.14)
Depends: libpam-modules
Depends: libpam0g (>= 0.99.7.1)
Depends: libselinux1 (>= 1.32)
Depends: libsemanage1 (>= 2.0.3)
libaudit1
Depends: libaudit-common (>= 1:2.6.7-2)
Depends: libc6 (>= 2.14)
Depends: libcap-ng0
libaudit-common
libcap-ng0
Depends: libc6 (>= 2.8)
libpam-modules
PreDepends: debconf (>= 0.5)
PreDepends: debconf-2.0
PreDepends: libaudit1 (>= 1:2.2.1)
PreDepends: libc6 (>= 2.15)
PreDepends: libdb5.3
PreDepends: libpam-modules-bin (= 1.1.8-3.6)
PreDepends: libpam0g (>= 1.1.3-2)
PreDepends: libselinux1 (>= 2.1.9)
debconf
PreDepends: perl-base (>= 5.20.1-3~)
perl-base
PreDepends: dpkg (>= 1.17.17)
PreDepends: libc6 (>= 2.23)
dpkg
Depends: tar (>= 1.28-1)
PreDepends: libbz2-1.0
PreDepends: libc6 (>= 2.14)
PreDepends: liblzma5 (>= 5.2.2)
PreDepends: libselinux1 (>= 2.3)
PreDepends: zlib1g (>= 1:1.1.4)
tar
PreDepends: libacl1 (>= 2.2.51-8)
PreDepends: libc6 (>= 2.17)
PreDepends: libselinux1 (>= 1.32)
libacl1
Depends: libattr1 (>= 1:2.4.46-8)
Depends: libc6 (>= 2.14)
libattr1
Depends: libc6 (>= 2.4)
libselinux1
Depends: libc6 (>= 2.14)
Depends: libpcre3
libpcre3
Depends: libc6 (>= 2.14)
PreDepends: multiarch-support
multiarch-support
Depends: libc6 (>= 2.3.6-2)
libbz2-1.0
Depends: libc6 (>= 2.4)
liblzma5
Depends: libc6 (>= 2.17)
zlib1g
Depends: libc6 (>= 2.14)
debconf-2.0
libdb5.3
Depends: libc6 (>= 2.17)
libpam-modules-bin
Depends: libaudit1 (>= 1:2.2.1)
Depends: libc6 (>= 2.14)
Depends: libpam0g (>= 0.99.7.1)
Depends: libselinux1 (>= 1.32)
libpam0g
Depends: debconf (>= 0.5)
Depends: debconf-2.0
Depends: libaudit1 (>= 1:2.2.1)
Depends: libc6 (>= 2.14)
libsemanage1
Depends: libaudit1 (>= 1:2.2.1)
Depends: libbz2-1.0
Depends: libc6 (>= 2.14)
Depends: libselinux1 (>= 2.6)
Depends: libsemanage-common (= 2.6-2)
Depends: libsepol1 (>= 2.6)
Depends: libustr-1.0-1 (>= 1.0.4)
libsemanage-common
libsepol1
Depends: libc6 (>= 2.14)
libustr-1.0-1
Depends: libc6 (>= 2.14)
libaprutil1
Depends: libapr1 (>= 1.4.8-2~)
Depends: libc6 (>= 2.14)
Depends: libdb5.3
Depends: libexpat1 (>= 2.0.1)
Depends: libgdbm3 (>= 1.8.3)
Depends: libssl1.1 (>= 1.1.0)
Depends: libuuid1 (>= 2.16)
libexpat1
Depends: libc6 (>= 2.14)
libgdbm3
Depends: dpkg (>= 1.15.4)
Depends: install-info
Depends: libc6 (>= 2.14)
install-info
Depends: libc6 (>= 2.14)
PreDepends: dpkg (>= 1.16.1)
libssl1.1
Depends: debconf (>= 0.5)
Depends: debconf-2.0
Depends: libc6 (>= 2.14)
libaprutil1-dbd-freetds
libaprutil1-dbd-mysql
Depends: libaprutil1 (= 1.5.4-3)
Depends: libc6 (>= 2.4)
Depends: libmariadbclient18 (>= 5.5.36)
Depends: zlib1g (>= 1:1.1.4)
libmariadbclient18
Depends: libc6 (>= 2.17)
Depends: libstdc++6 (>= 5)
Depends: mysql-common
Depends: zlib1g (>= 1:1.1.4)
libstdc++6
Depends: gcc-6-base (= 6.3.0-18+deb9u1)
Depends: libc6 (>= 2.18)
Depends: libgcc1 (>= 1:4.2)
mysql-common
libaprutil1-dbd-odbc
Depends: libaprutil1 (= 1.5.4-3)
Depends: libc6 (>= 2.14)
Depends: libodbc1 (>= 2.3.1)
libodbc1
Depends: libc6 (>= 2.14)
Depends: libltdl7 (>= 2.4.6)
libltdl7
Depends: libc6 (>= 2.14)
libaprutil1-dbd-pgsql
Depends: libaprutil1 (= 1.5.4-3)
Depends: libc6 (>= 2.14)
Depends: libpq5
libpq5
Depends: libc6 (>= 2.14)
Depends: libgssapi-krb5-2 (>= 1.14+dfsg)
Depends: libldap-2.4-2 (>= 2.4.7)
Depends: libssl1.1 (>= 1.1.0)
libgssapi-krb5-2
Depends: libc6 (>= 2.14)
Depends: libcomerr2 (>= 1.34)
Depends: libk5crypto3 (>= 1.8+dfsg)
Depends: libkeyutils1 (>= 1.4)
Depends: libkrb5-3 (= 1.15-1+deb9u1)
Depends: libkrb5support0 (>= 1.15~beta1)
libcomerr2
Depends: libc6 (>= 2.17)
libk5crypto3
Depends: libc6 (>= 2.14)
Depends: libkeyutils1 (>= 1.4)
Depends: libkrb5support0 (>= 1.15~beta1)
libkeyutils1
Depends: libc6 (>= 2.14)
libkrb5support0
Depends: libc6 (>= 2.14)
Depends: libkeyutils1 (>= 1.4)
libkrb5-3
Depends: libc6 (>= 2.16)
Depends: libcomerr2 (>= 1.34)
Depends: libk5crypto3 (>= 1.15~beta1)
Depends: libkeyutils1 (>= 1.5.9)
Depends: libkrb5support0 (= 1.15-1+deb9u1)
libldap-2.4-2
Depends: libc6 (>= 2.14)
Depends: libgnutls30 (>= 3.5.6)
Depends: libldap-common (>= 2.4.44+dfsg-5+deb9u1)
Depends: libsasl2-2
libgnutls30
Depends: libc6 (>= 2.22)
Depends: libgmp10 (>= 2:6)
Depends: libhogweed4
Depends: libidn11 (>= 1.13)
Depends: libnettle6
Depends: libp11-kit0 (>= 0.23.1)
Depends: libtasn1-6 (>= 4.9)
Depends: zlib1g (>= 1:1.1.4)
libgmp10
Depends: libc6 (>= 2.14)
libhogweed4
Depends: libc6 (>= 2.14)
Depends: libgmp10 (>= 2:6.0.0)
Depends: libnettle6 (= 3.3-1+b2)
libnettle6
Depends: libc6 (>= 2.14)
libidn11
Depends: libc6 (>= 2.14)
libp11-kit0
Depends: libc6 (>= 2.16)
Depends: libffi6 (>= 3.0.4)
libffi6
Depends: libc6 (>= 2.14)
libtasn1-6
Depends: libc6 (>= 2.14)
libldap-common
libsasl2-2
Depends: libc6 (>= 2.15)
Depends: libsasl2-modules-db (>= 2.1.27~101-g0780600+dfsg-3)
libsasl2-modules-db
Depends: libc6 (>= 2.14)
Depends: libdb5.3
libaprutil1-dbd-sqlite3
Depends: libaprutil1 (= 1.5.4-3)
Depends: libc6 (>= 2.4)
Depends: libsqlite3-0 (>= 3.5.9)
libsqlite3-0
Depends: libc6 (>= 2.14)
libaprutil1-ldap
Depends: libaprutil1 (= 1.5.4-3)
Depends: libc6 (>= 2.4)
Depends: libldap-2.4-2 (>= 2.4.7)
liblua5.2-0
Depends: libc6 (>= 2.14)
Depends: libgcc1 (>= 1:3.0)
Depends: libstdc++6 (>= 4.1.1)
libnghttp2-14
Depends: libc6 (>= 2.14)
libssl1.0.2
Depends: debconf (>= 0.5)
Depends: debconf-2.0
Depends: libc6 (>= 2.14)
libxml2
Depends: libc6 (>= 2.15)
Depends: libicu57 (>= 57.1-1~)
Depends: liblzma5 (>= 5.1.1alpha+20120614)
Depends: zlib1g (>= 1:1.2.3.3)
libicu57
Depends: libc6 (>= 2.14)
Depends: libgcc1 (>= 1:3.0)
Depends: libstdc++6 (>= 5.2)
perl:any
libmagic1
Depends: libc6 (>= 2.15)
Depends: libmagic-mgc (= 1:5.30-1+deb9u1)
Depends: zlib1g (>= 1:1.1.4)
libmagic-mgc
mime-support
php7.0-cli
Depends: libc6 (>= 2.15)
Depends: libedit2 (>= 2.11-20080614-4)
Depends: libmagic1
Depends: libpcre3 (>= 1:8.20)
Depends: libssl1.1 (>= 1.1.0)
Depends: libxml2 (>= 2.8.0)
Depends: mime-support
Depends: php7.0-common (= 7.0.27-0+deb9u1)
Depends: php7.0-json
Depends: php7.0-opcache
Depends: php7.0-readline
Depends: tzdata
Depends: ucf
Depends: zlib1g (>= 1:1.1.4)
libedit2
Depends: libbsd0 (>= 0.0)
Depends: libc6 (>= 2.17)
Depends: libncurses5 (>= 6)
Depends: libtinfo5 (>= 6)
libbsd0
Depends: libc6 (>= 2.16)
libncurses5
Depends: libc6 (>= 2.14)
Depends: libtinfo5 (= 6.0+20161126-1+deb9u2)
libtinfo5
Depends: libc6 (>= 2.16)
php7.0-common
Depends: libc6 (>= 2.15)
Depends: libssl1.1 (>= 1.1.0)
Depends: php-common (>= 1:35)
Depends: ucf
php-common
Depends: init-system-helpers (>= 1.18~)
Depends: psmisc (>= 22.15-1~)
Depends: sed (>= 4.1.1-1)
init-system-helpers
Depends: perl-base (>= 5.20.1-3)
psmisc
Depends: libc6 (>= 2.14)
Depends: libselinux1 (>= 1.32)
Depends: libtinfo5 (>= 6)
sed
PreDepends: libc6 (>= 2.14)
PreDepends: libselinux1 (>= 1.32)
ucf
Depends: coreutils (>= 5.91)
Depends: debconf (>= 1.5.19)
coreutils
PreDepends: libacl1 (>= 2.2.51-8)
PreDepends: libattr1 (>= 1:2.4.46-8)
PreDepends: libc6 (>= 2.17)
PreDepends: libselinux1 (>= 2.1.13)
php7.0-json
Depends: libc6 (>= 2.14)
Depends: php-common (>= 1:35)
Depends: php7.0-common (= 7.0.27-0+deb9u1)
Depends: ucf
php7.0-opcache
Depends: libc6 (>= 2.14)
Depends: php-common (>= 1:35)
Depends: php7.0-common (= 7.0.27-0+deb9u1)
Depends: ucf
php7.0-readline
Depends: libc6 (>= 2.14)
Depends: libedit2 (>= 3.1-20130611)
Depends: libncurses5 (>= 6)
Depends: libtinfo5 (>= 6)
Depends: php-common (>= 1:35)
Depends: php7.0-common (= 7.0.27-0+deb9u1)
Depends: ucf
tzdata
Depends: debconf (>= 0.5)
Depends: debconf-2.0

Falko Timme

About Falko Timme

Falko Timme is an experienced Linux administrator and founder of Timme Hosting, a leading nginx business hosting company in Germany. He is one of the most active authors on HowtoForge since 2005 and one of the core developers of ISPConfig since 2000. He has also contributed to the O'Reilly book "Linux System Administration".

Share this page:

Suggested articles

1 Comment(s)

Add comment

Comments

By: Fens at: 2017-04-06 00:41:04

No need to install apt-rdepends, there is a command that you can use with some extra arguments (dpkg-query maybe or something), but I forgot which one it is.