Last Edited: 01 May 2008 by superuser
Importered from old WiKi -- 30/04-08 17:04.

Library Dependencies

Last edited by Wosh
Sat, 24 Nov 2007 21:31 GMT [diff]

A list of which applications depend on which libraries

- useful when deciding on what can/can't be removed when doing a remaster.

This list is currently based on Puppy107

  • fig2dev: needed if you keep Figurine
  • libdaemon: required for ifplugstatus & hence eth
  • libmad: needed if you keep Graveman (libid3tag)
  • libwmf: needed if you keep Abiword
  • libxml2: required for ROX (desktop icons & File manager)
  • nenscript: needed if you want to print from Beaver (& some other apps?)
  • xli: needed for background image to be loaded in X

If anyone knows what these are needed for in Puppy, then please add details (I've stripped them without apparent problems):

  • bcrypt is used for encrypting files using blowfish, probably nothing depends on it.
  • cramfs
  • gifsicle
  • lame is used for generating MP3 audio files but is proabbly loaded dynamically by audio apps as needed, so can be omitted if you do not need to create MP3 files
  • libart_lgpl
  • libexif
  • libexpat
  • libghttp
  • libgphoto2
  • libpcre is used by a couple of test applications in usr_devx, but nothing in Puppy itself.
  • libxslt is used by /usr/bin/xsltproc, as you might expect.
  • libzvt does not seem to be used at all
  • libnetpbm is used by the suite of graphics converters such as /usr/bin/pnmtojpeg. See http://netpbm.sourceforge.net/doc/
  • pstoedit
  • scale2x


From JonathanMarsden:
Can't we automatically produce such a list? Basically run ldd over
every dynamically linked executable in the distribution, recording the
results, and then sorting by library? It doesn't sound like something
that should be created by hand, to me.

Try this (lengthy) one-liner:

for i in `find / -type f -perm +1 |xargs file |grep executable \
  |grep Intel |grep dynamic |cut -d : -f1 ` ; do echo $i ; ldd $i ; done

as a starting point. It's output is listed by executable, not yet by
lib. It's late, so I'll let someone else post the Perl or awk code to
read this into an assoc array and spit out the info by library -- it's
probably just another one-liner :-)

Modifying my one-liner for this a little leads to
(a) a way to get the info as one line per program:

for i in `find / -type f -perm +1 |grep -v ^/\.usr \
    | xargs file | grep executable | grep Intel | grep dynamic \
    | cut -d : -f1 ` ; do echo $i: `ldd $i | sed -e 's@^.*=> @@' -e 's@ (.*$@@'` ; done

and so (b) a list of binaries that have missing libs:

for i in `find / -type f -perm +1 |grep -v ^/\.usr \
    | xargs file | grep executable | grep Intel | grep dynamic \
    | cut -d : -f1 ` ; do echo $i: `ldd $i | grep "not found"` ; \
    done | grep "not found"

displays a list of programs and the libs they are missing.


JonathanMarsden continues:

It turns out that what we need to know about each dynamic lib is its name, not the path to the file that satisfies the dependency. Also every dynamically linked executable that links to anything dynamically will use /lib/ld-linux.so.2. So it's better to use:

for i in `find / -type f -perm +1 |grep -v ^/\.usr \
|xargs file |grep executable |grep Intel |grep dynamic \
|cut -d : -f1 ` ; do echo $i: `ldd $i \
|sed -e "s@ => /[^ ]\+ (0x[0-9a-f]\+)@@g" -e "s@/lib/ld-linux.so.2 (0x40000000)@@"` ; done

That gets you output lines looking like:

/usr/sbin/ifrename: libiw.so.27 libm.so.6 libc.so.6
/usr/sbin/ifstat: libm.so.6 libc.so.6

Now you need to permute those (so the key is the library name, the values are lists of filenames). I hacked up a perl script which I called permute.pl for this:

#!/usr/bin/perl
while (<STDIN>) {
  m/^(.*): (.*)$/ ;
  my $file="$1";
  foreach $i (split(" ", $2)) {
    $libs{"$i"}=((defined($libs{"$i"}))? $libs{"$i"} : '' ) . "$file ";
  }
}

foreach $i (sort keys %libs) {
  print "$i: " . $libs{"$i"} . "\n";
}

The output generated by running permute.pl on the output of the find command above on this Puppy system (1.0.7 with usr_devx) can be seen at LibraryDependencyList . Note that the lines beginning with =>:, found: and not: list executables with missing libraries and should really be removed from the output.



CategoryReleases