Comment 11 for bug 366728

Revision history for this message
robinmills (robinmills) wrote : Re: LD_LIBRARY_PATH not loads from .profile

There is something very mysterious about LD_LIBRARY_PATH. It most certainly appears to be unset during startup. I've tried all the usual places /etc/profile and so on. I can set it in ~/.profile - however that's only effective when I for the bash shell. Processes started by the Windows Manager (eg QtCreator) do not execute ~/.profile (which is a bash-ism).

However it seems that while Ubuntu does respect LD_LIBRARY_PATH, it has another mechanism for locating dynamic libraries. If you run sudo ldconfig --verbose, it rebuilds a cache of shared libraries. So if you add a shared library (as I did) to /usr/local/lib, the correct medicine to make it available to run sudo ldconfig.

Of course this doesn't solve the inconvenience that LD_LIBRARY_PATH is somehow unset during startup. Perhaps a wizard on ldconfig can explain more about this.