[vc_row][vc_column width=”1/1″][vc_column_text]A typical .deb package relies on other packages to install and operate properly. With package managers such as apt-get and aptitude, you can resolve package dependencies, and have all prerequisites installed automatically.
Suppose for whatever reason, you want to manually resolve package dependencies of a particular package, in which case you need to identify all its dependent packages first.
In the following, I will explain how to check package dependencies on pcDuino Ubuntu.
A command-line tool called apt-rdepends can help you in this case. This tool can recursively check dependencies of .deb package, and list all found package dependencies.
To install apt-rdepends on Ubuntu or Debian:
To show package dependency information of a particular package (e.g., tcpdump), run the command with package name:
Reading package lists... Done Building dependency tree Reading state information... Done tcpdump Depends: libc6 (>= 2.7) Depends: libpcap0.8 (>= 1.2.1) Depends: libssl1.0.0 (>= 1.0.0) libc6 Depends: libgcc1 libgcc1 Depends: gcc-4.6-base (= 4.6.3-1ubuntu5) Depends: libc6 (>= 2.15-0ubuntu8) PreDepends: multiarch-support gcc-4.6-base multiarch-support Depends: libc6 (>= 2.13-0ubuntu6) libpcap0.8 Depends: libc6 (>= 2.11) PreDepends: multiarch-support libssl1.0.0 Depends: debconf (>= 0.5) Depends: debconf-2.0 Depends: libc6 (>= 2.15-0ubuntu8) Depends: libgcc1 (>= 1:4.4.0) Depends: zlib1g (>= 1:1.1.4) PreDepends: multiarch-support debconf PreDepends: perl-base (>= 5.6.1-4) perl-base PreDepends: dpkg (>= 1.14.20) PreDepends: libc6 (>= 2.11) dpkg PreDepends: coreutils (>= 5.93-1) PreDepends: libbz2-1.0 PreDepends: libc6 (>= 2.11) PreDepends: libgcc1 (>= 1:4.4.0) PreDepends: libselinux1 (>= 1.32) PreDepends: tar (>= 1.23) PreDepends: xz-utils PreDepends: zlib1g (>= 1:1.1.4) coreutils Depends: dpkg (>= 1.15.4) Depends: install-info PreDepends: libacl1 (>= 2.2.51-5) PreDepends: libattr1 (>= 1:2.4.46-5) PreDepends: libc6 (>= 2.15) PreDepends: libgcc1 (>= 1:4.4.0) PreDepends: libselinux1 (>= 1.32) . . . .
Visualization of Package Dependencies
The text output of apt-rdepends can be difficult to read due to many recursively defined dependency relationships. That is when visualization can help. apt-rdepends can export package dependency information into a dot file, which can be used by a GUI-based graph editor called dotty to visualize package dependencies in a graph format.
For visualization, first install dotty graph editor tool:
Finally, to visualize package dependencies with dotty:
$ dotty tcpdump.dot
The visualization result of tcpdump package looks like the following.