LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Which programs use which libraries and vice-versa (https://www.linuxquestions.org/questions/linux-software-2/which-programs-use-which-libraries-and-vice-versa-924123/)

mahkoe 01-16-2012 08:01 PM

Which programs use which libraries and vice-versa
 
I recently tried the newest version of crunchbang, and immediately after discovering iceweasel, I went straight back to my Ubuntu 10.10 install and found the .deb file online. When I tried to install, dpkg told me that it conflicts with hunspell-en-ca. I'm not really sure what this library does, (probably a spell-checker of sorts) but I would like to know which programs would be affected if I were to uninstall it. Is there a command to show which programs use which libraries and which libraries furnish to which programs (sorry for the awkward wording)?

Thanks

frankbell 01-16-2012 08:10 PM

Iceweasel is simply Firefox with the branding removed.

http://wiki.debian.org/Iceweasel

According to the listing in Synaptic, hunspell-en-ca is the Canadian English dictionary for hunspell.

mahkoe 01-16-2012 08:14 PM

Okay, well that works. But, now that I'm interested, does anyone know how to achieve the original goal of finding the ties between libraries and programs?

Dark_Helmet 01-16-2012 08:32 PM

Well, I think your question is not so much focused on libraries as it is general package dependencies.

I'll give you an approach for that in one second, but there is a very low-level approach for libraries specifically.

There's a program called "ldd" (not sure what package(s) provide it). If you run ldd on an executable binary (i.e. not a text script), it should tell you what libraries the binary might load at runtime. For example:
Code:

$ ldd `which awk`
        linux-vdso.so.1 =>  (0x00007fff00f21000)
        libm.so.6 => /lib/libm.so.6 (0x00007fb27c654000)
        libc.so.6 => /lib/libc.so.6 (0x00007fb27c2d1000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fb27c8e5000)

However, there is no way to go in reverse--that is, find all programs that depend on linux-vdso.so.1 for instance.

Back to the package dependency versus library dependency. Check out this page if you use Debian-style deb packages. The examples show how to create a dependency graph. For this to work, you need to have the "dot" program installed (which is included in the graphviz package).

It will generate a PNG file depicting what one (or more) packages are needed by any number of top-level packages. The web page also describes how to go in reverse (find all packages that depend on a specific package).

EDIT:
Be careful though. Some high level packages will generate a LOT of dependencies. For instance, I just ran the commands for package openvpn. The data file for the dot program was 200+ kilobytes in size. That will create a massive graph (and likely require a LONG time to process).

EDIT2:
I should also point out that you can get the package dependency information through apt-cache by itself (without the use of dot). See the man page for apt-cache and the "showpkg" action. For me, I prefer the visuals.


All times are GMT -5. The time now is 04:48 PM.