2

I could possibly write a script to do a combination of find, ldd, and grep, but wanted to find out if there is a better way.

For example if the library is /usr/lib/libmhash.so.2, I'd like to know all binaries on the system that link to it.

1 Answers1

0

I don't know of a standard way to do that without inspecting every binary. What you can do, although it's not quite the same thing, is look at the dependency information in your package manager. If you're using a Debian-based distro, apt-cache showpkg <package> will show, among other things, "reverse dependencies" - a list of all the packages that depend on that package.

For example, the following packages depend on libmhash2 on my system:

Reverse Depends: 
  libmhash2:i386,libmhash2
  yubiserver,libmhash2
  wxhexeditor,libmhash2
  wit,libmhash2
  vdetelweb,libmhash2
  thunar-gtkhash,libmhash2
  steghide,libmhash2
  python-mhash-dbg,libmhash2
  python-mhash,libmhash2
  proxytunnel,libmhash2
  passwordmaker-cli,libmhash2
  nd,libmhash2
  nautilus-gtkhash,libmhash2
  mcrypt,libmhash2 0.8.16-1
  mbuffer,libmhash2
  libgringotts2,libmhash2
  libcsync0,libmhash2
  gtkhash,libmhash2
  cd5,libmhash2
  aide-dynamic,libmhash2
  librasqal3,libmhash2
  libmhash-dev,libmhash2 0.9.9.9-2

Of course, this doesn't tell you about specific binaries, but it might solve your problem (or at least someone else's). If not, you can always use find/ldd/grep.

user55325
  • 5,113