Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I would like to install phpmyadmin on a production server, and apt says it will uninstall libgd2.

In this case I know libgd2 is not used, but I've asked myself if in another case I would be able to check if the library is used (and I didn't know how to do that).

So, is there any way to check when, or how, or by whom, a library is used?

Thanks.

Edit: when I say 'being used' I mean accessed or called. Where I work some people use libraries that come with the system on their own programs, sometimes happens that a user asks for a library being installed by it's own name, then I need to install something that disagree with that library and I do not know if the user still uses it.

share|improve this question
    
which distro are you using? –  wolfgangsz Oct 4 '10 at 16:31

2 Answers 2

Package management's the clean way to do this, but the this-is-a-nail-and-I-have-a-hammer approach would be something like:

find / -mode 755 -type f -exec ldd {} \; | grep libgd

I'm sure there's a better alternative to "-mode 755" to find anything 755/775/700/etc., but I don't know it offhand. But this'll certainly work!

share|improve this answer
    
Interesting approach. But, did you mean -perm where you typed -mode? –  marc.riera Oct 4 '10 at 21:48
    
Good point. That's what I get for writing command lines from memory. ;) –  BMDan Oct 4 '10 at 23:46

The answer depends on the distribution. Your wording suggests that you use Debian or Ubuntu. There, the answer is:

$ aptitude why libgd2-noxpm
i   trac-mastertickets Recommends trac-graphviz                                 
i A trac-graphviz      Depends    python-pygraphviz                             
i A python-pygraphviz  Depends    graphviz (>= 2.16)                            
i A graphviz           Depends    libgd2-noxpm (>= 2.0.36~rc1~dfsg) | libgd2-xpm
                                   (>= 2.0.36~rc1~dfsg)
share|improve this answer
    
Now, suppose you have trac-mastertickets installed but you are not using it. Is there any way to check if the library is beeing used? –  marc.riera Oct 4 '10 at 17:39
    
$ grep-available -F Depends libgd2-noxpm -s Package –  AEP Oct 6 '10 at 4:56

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.