apt-rdepends - list dependencies recursively

Forum rules
General talk about software - if the program is not in the repos, please links to the developer's page or github.
machinebacon
Baconator
Posts: 10253
Joined: Thu Sep 16, 2010 11:03 am
Location: Pfälzerwald
Contact:

apt-rdepends - list dependencies recursively

Unread post by machinebacon » Mon Jul 14, 2014 5:25 am

Of course it could be done with piping apt-cache depends into a ever-growing tempfile. This is apt-rdepends, which should have been built into apt-cache. Let's see how they compare:

Code: Select all

bbq:~$ apt-cache depends bash
bash
  Depends: base-files
  Depends: debianutils
  PreDepends: dash
  PreDepends: libc6
  PreDepends: libncurses5
  PreDepends: libtinfo5
  Suggests: bash-doc
  Recommends: bash-completion
  Conflicts: bash-completion
  Replaces: bash-completion
  Replaces: bash-doc


 bbq:~$ apt-rdepends bash
Reading package lists... Done
Building dependency tree       
Reading state information... Done
bash
  Depends: base-files (>= 2.1.12)
  Depends: debianutils (>= 2.15)
  PreDepends: dash (>= 0.5.5.1-2.2)
  PreDepends: libc6 (>= 2.15)
  PreDepends: libncurses5 (>= 5.5-5~)
  PreDepends: libtinfo5
base-files
  PreDepends: awk
awk
debianutils
  Depends: sensible-utils
  PreDepends: libc6 (>= 2.15)
sensible-utils
libc6
  Depends: libgcc1
libgcc1
  Depends: gcc-4.8-base (= 4.8.2-3~pre5)
  Depends: libc6 (>= 2.2.4)
  PreDepends: multiarch-support
gcc-4.8-base
multiarch-support
  Depends: libc6 (>= 2.13-5)
dash
  Depends: debianutils (>= 2.15)
  Depends: dpkg (>= 1.15.0)
  PreDepends: libc6 (>= 2.11)
dpkg
  PreDepends: libbz2-1.0
  PreDepends: libc6 (>= 2.11)
  PreDepends: liblzma5 (>= 5.1.1alpha+20120614)
  PreDepends: libselinux1 (>= 2.1.0)
  PreDepends: tar (>= 1.23)
  PreDepends: zlib1g (>= 1:1.1.4)
libbz2-1.0
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
liblzma5
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
libselinux1
  Depends: libc6 (>= 2.8)
  Depends: libpcre3 (>= 8.10)
  PreDepends: multiarch-support
libpcre3
  Depends: libc6 (>= 2.3)
  PreDepends: multiarch-support
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.4)
  PreDepends: multiarch-support
libattr1
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
zlib1g
  Depends: libc6 (>= 2.4)
  PreDepends: multiarch-support
libncurses5
  Depends: libc6 (>= 2.15)
  Depends: libtinfo5 (= 5.9+20140118-1)
  PreDepends: libtinfo5 (>= 5.9-3)
  PreDepends: multiarch-support
libtinfo5
  Depends: libc6 (>= 2.15)
  PreDepends: multiarch-support
So, if you want to see how packages are related to each other, this is the program of choice. You can also visualize it using springgraph, but I haven't tried it. You might pipe the input into a FILE, and then use "sort $FILE | uniq -u" to show unique lines (so, no twenty multiarch-supports)

Code: Select all

 bbq:~$ sort bash.file | uniq -u
awk
base-files
bash
dash
debianutils
  Depends: base-files (>= 2.1.12)
  Depends: dpkg (>= 1.15.0)
  Depends: gcc-4.8-base (= 4.8.2-3~pre5)
  Depends: libattr1 (>= 1:2.4.46-8)
  Depends: libc6 (>= 2.13-5)
  Depends: libc6 (>= 2.2.4)
  Depends: libc6 (>= 2.3)
  Depends: libc6 (>= 2.8)
  Depends: libgcc1
  Depends: libpcre3 (>= 8.10)
  Depends: libtinfo5 (= 5.9+20140118-1)
  Depends: sensible-utils
dpkg
gcc-4.8-base
libacl1
libattr1
libbz2-1.0
libc6
libgcc1
liblzma5
libncurses5
libpcre3
libselinux1
libtinfo5
multiarch-support
  PreDepends: awk
  PreDepends: dash (>= 0.5.5.1-2.2)
  PreDepends: libacl1 (>= 2.2.51-8)
  PreDepends: libbz2-1.0
  PreDepends: libc6 (>= 2.17)
  PreDepends: liblzma5 (>= 5.1.1alpha+20120614)
  PreDepends: libncurses5 (>= 5.5-5~)
  PreDepends: libselinux1 (>= 1.32)
  PreDepends: libselinux1 (>= 2.1.0)
  PreDepends: libtinfo5
  PreDepends: libtinfo5 (>= 5.9-3)
  PreDepends: tar (>= 1.23)
  PreDepends: zlib1g (>= 1:1.1.4)
sensible-utils
tar
zlib1g
By the way, if you want it more visual, install "debtree xdot" and then do a "debtree -b bash | xdot". But this is uncool.
..gnutella..

User avatar
Alad
should take a shower
Posts: 447
Joined: Wed May 21, 2014 12:52 am

Re: apt-rdepends - list dependencies recursively

Unread post by Alad » Mon Jul 14, 2014 6:21 am

Explore bloat. Nice.
It's funny how we used to be able to do real stuff with rudimentary computers, but now we can't. -- ratcheer

User avatar
GekkoP
Emacs Sancho Panza
Posts: 5878
Joined: Tue Sep 03, 2013 7:05 am

Re: apt-rdepends - list dependencies recursively

Unread post by GekkoP » Mon Jul 14, 2014 9:02 am

Easier to track down to bloat with this, thanks.

Post Reply