Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried to install OpenLDAP with some steps I did before in other installation under the same conditions in Ubuntu 12.04

I've followed the manual that OpenLDAP has on line... But when I try to make test it fails in the first test... and checking the log of tests for errors it says:

error while loading shared libraries: cannot open shared object file: No such file or directory

I've searched on internet an the solution they said it's to add in the ./configure the paths for the libraries... so I did it:

LD_LIBRARY_PATH="/usr/lib:/usr/local/lib:/usr/local/db5/lib:/usr/local/cyrus/lib" LDFLAGS="-L/usr/local/db5/lib -L/usr/local/cyrus/lib" CPPFLAGS="-I/usr/local/include -I/usr/local/db5/include -I/usr/local/cyrus/include" ./configure -prefix=/usr/local/ldap --with-cyrus-sasl --with-tls

but still nothing... any idea on how could I solve this??

share|improve this question
Do you have a file on your system called – David Schwartz Jan 20 '13 at 2:32
@DavidSchwartz yes it is in /usr/local/db5/lib/ – poz2k4444 Jan 20 '13 at 21:02
up vote 2 down vote accepted

Create file /etc/ with following line


Then run ldconfig.

Test again.

This put /usr/local/db5/lib into the system library search path.

share|improve this answer
this worked perfectly, could you explain how it works for future troubleshooting?? with this or other program? – poz2k4444 Jan 22 '13 at 20:42
Actually the last line is a simple explanation. The (dynamic linker/loader) holds a list of directories where libraries reside. The standard(pre-configured) path include /lib, /usr/lib, etc. In this case, is not in any of those path. So we put in a config file to notify it. ldconfig is used to update the link cache(/etc/, whenever there are changes to those information. So next time you run into similar situation, you can create a new .conf file specific for that library and run ldconfig again. – John Siu Jan 22 '13 at 20:51
And the name of the file doesn't matter?? just that it has the path to the library I want is enough?? – poz2k4444 Jan 23 '13 at 3:25
Partially matter, it must use .conf for extension. It is also a good practice to use meaningful name closely related to the lib/package. – John Siu Jan 23 '13 at 3:40
just one more question (I hope), why it doesn't get the path when I specifically put it on the ./configure line?? – poz2k4444 Jan 23 '13 at 3:44

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.