Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

What can you do when your linux system "can't find" dynamically linked libraries that are indeed installed in their correct locations?

Case in point, I'm trying to run a program called 'ucanvcam':

oliver@human ~/installed/ucanvcam-0.1.6/bin $ ./ucanvcam
./ucanvcam: error while loading shared libraries: libgd.so.2: cannot open shared object file: No such file or directory

oliver@human ~/installed/ucanvcam-0.1.6/bin $ locate libgd.so.2

oliver@human ~/installed/ucanvcam-0.1.6/bin $ ldd ./ucanvcam
    linux-gate.so.1 =>  (0xf7706000)
    libgd.so.2 => not found
    librt.so.1 => /lib32/librt.so.1 (0xf6b1e000)

How can I tell it to look for libgd.so.2 in /usr/lib64? And more importantly, why isn't it looking there, and where is it looking?


share|improve this question

1 Answer 1

up vote 1 down vote accepted

The manual page for ld.so will help you with this. In particular the important things to look at are probably the contents of your shell variable LD_LIBRARY_PATH and the file /etc/ld.so.conf.

share|improve this answer
Thank you, setting my LD_LIBRARY_PATH variable worked a charm :) –  Mala Apr 28 '10 at 21:33
Some (among others stackoverflow.com/a/5104803/204658, or google it) consider setting LD_LIBRARY_PATH a bad practice. –  Thomas Nilsson Aug 17 '14 at 14:23

Your Answer


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.