0

I upgraded my system from 14.04 to 16.04 a while ago, but this problem has been really bothering me since, and I still don't have a solution.

When I start an application from a launcher (like MATLAB), I found that the LD_LIBRARY_PATH variable is not defined as in my .bashrc file, which causes that some of my codes stop working.

Similarly, when I double-clicking a binary and start those from Thunar, the application is also not aware of the environment var settings in .bashrc.

can anyone know to fix this problem? it worked perfectly fine in xubuntu 14.04 and older versions.

  • .bashrc is only sourced by bash, and only under certain circumstances (see "Invocation" in man bash). Check the launcher file, my guess is that bash is not even involved when starting the application from the launcher or executing a binary from thunar. So you'll probably want to define the environment variables in a file that also affects thunar's environment. I'm sure there are Q&As available on AskUbuntu that already explain how to do that. – danzel Mar 20 at 11:36
1

If the problem you are describing is that it is failing to source your bashrc file, try the following: Check your ~/.profile file and add something like this:

if [ -n "$BASH_VERSION" ]; then
    if [ -f "$HOME/.bashrc" ]; then
        . "$HOME/.bashrc"
    fi
fi

Then, try opening a terminal again and see if it sources it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.