Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Persistent library search path in Linux

I want to change LD_LIBRARY_PATH variable globally, to use some strange third-party SDK, which places its shared libraries to custom directories. So, I added such script to /etc/profile.d:

LD_LIBRARY_PATH=/usr/local/ebus_sdk/lib/genicam/bin/Linux64_x64:/usr/local/ebus_sdk/lib/qt/lib:/usr/local/ebus_sdk/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH

After reboot, I type this in the command line:

alex@alex-64:~$ echo $LD_LIBRARY_PATH
.

So, this way doesn't work. Is there any other way to add these directories to the library search path?

like image 455
Alex F Avatar asked Oct 29 '25 16:10

Alex F


1 Answers

Most linux distros would have you add a file to the /etc/ld.so.conf.d directory which contains the path to search for the libraries. This is a convenient way for installers like rpm and dpkg to install and uninstall a package's system changes.

like image 140
Brian Cain Avatar answered Oct 31 '25 06:10

Brian Cain