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 thatbash
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 '19 at 11:36pstree
orksysguard
to view the process tree. For setting environment variables, see this answer for a quick reference or the Ubuntu help page for more detailed information. The easiest approach is probably adding the variable to/etc/environment
, but since the variable you are setting is very generic, you'll probably want a solution more specific to the application like usingenv
in the launcher's exec line or using a wrapper script. – danzel May 03 '19 at 07:49