I am trying to find orphan library packages. Following commands give all the libraries needed by all executables in /usr/bin folder:
Code:
$ cd /usr/bin
$ for FF in *; do ldd $FF; done | cut -d '=' -f 1 | cut -d '(' -f 1 | sort | uniq > ~/lddout.txt
This produces a list of about 1150 library files needed on my system.
For getting installed library files, I can run:
Code:
$ cd /usr/lib
$ find -type f -printf "%f\n" | sort > ~/libout.txt
Is it possible to find orphan library packages (i.e. those packages which are not needed by any other package) by comparing (using diff command) the lddout.txt and libout.txt files? Thanks for your help.