How to set the environmental variable LD_LIBRARY_PATH in linux

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, typing echo $LD_LIBRARY_PATH displays no result.

How to set the path permanently?

Leave a Comment