Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Linux by (18.4k points)

I have first executed the command: export 

LD_LIBRARY_PATH=/usr/local/lib

Then I have opened .bash_profile file: vi ~/.bash_profile. In this file, I put:

LD_LIBRARY_PATH=/usr/local/lib

export LD_LIBRARY_PATH

Then if the terminal is closed and restarted, 

echo $LD_LIBRARY_PATH 

Typing displays no result. How to set the path permanently?

1 Answer

0 votes
by (36.8k points)

You need to add more details about your distribution, for example under Ubuntu your right way to do this is to add the custom .conf file to /etc/ld.so.conf.d, for example

sudo gedit /etc/ld.so.conf.d/randomLibs.conf

Inside a file, you are supposed to write a complete path to a directory that contains all these libraries that you wish to add to a system, for example

/home/linux/myLocalLibs

remember to add only this path to a dir, not a full path for this file, all the libs inside that path will be automatically indexed.

Save and run the sudo ldconfig to update the system with these libs.

Come and join linux training to gain great knowledge.

Related questions

0 votes
1 answer
asked Dec 16, 2020 in Linux by blackindya (18.4k points)
0 votes
1 answer

Browse Categories

...