I have first executed the command: export LD_LIBRARY_PATH=/usr/local/lib
Then I have opened .bash_profile
file: vi ~/.bash_profile
Keep the previous path, don't overwrite it:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/
You can add it to your ~/.bashrc:
echo 'export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/your/custom/path/' >> ~/.bashrc
The file .bash_profile
is only executed by login shells. You may need to put it in ~/.bashrc
, or simply logout and login again.
Place the following line at the end
export LD_LIBRARY_PATH=<your path>
Save and Exit.
Execute this command
sudo ldconfig
For some reason no one has mentioned the fact that the bashrc needs to be re-sourced after editing. You can either log out and log back in (like mentioned above) but you can also use the commands: source ~/.bashrc
or . ~/.bashrc
.