How can I set LD_LIBRARY_PATH permanently?


I want to change LD_LIBRARY_PATH to /usr/local/lib.
But everytime I do that, the change did’t applied.
When I echo the LD_LIBRARY_PATH it shows me the path but when I reopen the terminal LD_LIBRARY_PATH remains empty and even my programs did’t see changes.
I tried this: how to set LD_LIBRARY_PATH?

And yes, I used the export command.

Is there any way to change it or I am wrong with something?


Did you put it in .bashrc?

How are you running your program?

Here’s a ‘tutorial’ that clarifies why Joe asked about .bashrc. There are many others + topics on the typical technical boards if you need more info.



It was in bash_profile.
Now it’s solved

1 Like

Thanks for the tutorial! Now it’s solved!

1 Like