Search the PATH for any missing libraries

The following command will search for all the binaries located in your $PATH and tell you if any program is missing some shared libraries (.so) to be able to run correctly. I often use it after a distro upgrade:

root# find $(echo $PATH | tr : '\n' | sort -u | tr '\n' ' ') -mindepth 1 -maxdepth 1 -type f -perm /111 -print0 | xargs -r0 ldd | grep -E 'not found|:$' | grep -B1 'not found'

Output example :

#
/usr/bin/gnucash-bin:
libgnc-qof.so.1 => not found
libgncmod-engine.so => not found
libgnc-gnome.so.0 => not found
libgncmod-ledger-core.so => not found
libgncmod-register-gnome.so => not found
libgncmod-register-core.so => not found
libgncmod-report-gnome.so => not found
libgncmod-report-system.so => not found
libgncmod-gnome-search.so => not found
libgncmod-gnome-utils.so => not found
libgnc-backend-file-utils.so.0 => not found
libgncmod-app-utils.so => not found
libgnc-module.so.0 => not found
libgncmod-calculation.so => not found
libgnc-core-utils.so.0 => not found
--
/usr/NX/bin/nxservice:
libXcomp.so.3 => not found
libXcompsh.so.3 => not found
--
/usr/NX/bin/nxssh:
libXcomp.so.3 => not found
--
/usr/NX/bin/nxagent:
libXcomp.so.3 => not found
libXcompext.so.3 => not found
libXcompshad.so.3 => not found

Hmm, NX puts its libs in /usr/NX/lib, so this is normal (it probably uses LD_LIBRARY_PATH). But for gnucash, it seems like I have some things to fix 🙂