Create a graph of package dependencies with the Linux command line.

Posted: November 12, 2016. At: 11:44 AM. This was 11 months ago. Post ID: 9923

There is a way to create a graphical display of the package relations amongst your installed packages on a Debian system. The graphviz package allows this.

Firstly, install the debtree package.

apt install debtree
apt install graphviz

Then run this command to see all of the package dependencies and relations for the mc package.

debtree mc | dot -Tpng > mc.png

This is what I got when I ran this command, this graph shows the package dependencies for the mc package.

Package dependencies for the mc package.
Package dependencies for the mc package.

Another way is to use the apt-rdepends package.

Install this package.

apt install apt-rdepends

Then run this command to view a list of dependencies.

┌─[✗]─[[email protected]]─[~]
└──╼ $apt-rdepends mc
Reading package lists... Done
Building dependency tree       
Reading state information... Done
mc
  Depends: e2fslibs (>= 1.37)
  Depends: libc6 (>= 2.15)
  Depends: libglib2.0-0 (>= 2.35.9)
  Depends: libgpm2 (>= 1.20.4)
  Depends: libslang2 (>= 2.2.4)
  Depends: libssh2-1 (>= 1.2.5)
  Depends: mc-data (= 3:4.8.15-2)
e2fslibs
  Depends: libc6 (>= 2.17)
libc6
  Depends: libgcc1
libgcc1
  Depends: gcc-6-base (= 6.0.1-0ubuntu1)
  Depends: libc6 (>= 2.14)
gcc-6-base
libglib2.0-0
  Depends: libc6 (>= 2.17)
  Depends: libffi6 (>= 3.0.4)
  Depends: libpcre3
  Depends: libselinux1 (>= 1.32)
  Depends: zlib1g (>= 1:1.2.2)
libffi6
  Depends: libc6 (>= 2.14)
libpcre3
  Depends: libc6 (>= 2.14)
  PreDepends: multiarch-support
multiarch-support
  Depends: libc6 (>= 2.3.6-2)
libselinux1
  Depends: libc6 (>= 2.14)
  Depends: libpcre3
zlib1g
  Depends: libc6 (>= 2.14)
libgpm2
  Depends: libc6 (>= 2.15)
  PreDepends: multiarch-support
libslang2
  Depends: libc6 (>= 2.14)
  PreDepends: multiarch-support
libssh2-1
  Depends: libc6 (>= 2.14)
  Depends: libgcrypt20 (>= 1.6.1)
  Depends: zlib1g (>= 1:1.1.4)
  PreDepends: multiarch-support
libgcrypt20
  Depends: libc6 (>= 2.15)
  Depends: libgpg-error0 (>= 1.14)
libgpg-error0
  Depends: libc6 (>= 2.15)
mc-data

The debtree package is the best way though, this coupled with the graphviz package allows a good visualization of the actual dependencies of a package.

No comments have been made. Use this form to start the conversation :)

Leave a Reply