[SOLVED] Can not set PATH permanently in order to launch MATLAB system wide
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Can not set PATH permanently in order to launch MATLAB system wide
Hi to all,
I have the following issue:
I recently installed MATLAB R2018a in my artix linux (runit). I can launch matlab from the location where the launcher is, i.e.,
/usr/local/MATLAB/R2018a/bin, but if i try to launch it from another location i can't. So i tried to append the mentioned directory to PATH with different methods:
You need to put that $PATH expansion into /etc/profile or ~/.bashrc so that it becomes active on boot or login rather than only when you manually do that from the cli.
and now i can launch matlab from terminal, but not from dmenu, where matlab appears but does not launch from there.What could be the issue in the last case?
The system only processes /etc/profile when you open the terminal and get the shell environment.
You need a shell script for matlab that adds that to $PATH before it calls matlab directly.
On my system matlab is at /usr/local/bin/matlab so it could be renamed to /usr/local/bin/matlab.b and a script named /usr/local/bin/matlab could contain
I am not aware what zsh uses, but on a bash based system the file ~/.bash_profile gets read at login so that equivalent could be used to set that path for your use with matlab and so not need to make the changes I gave above.
Duplicate the entry in ~/.bashrc or its equivalent so it is available for non-login use as well.
Last edited by computersavvy; 01-20-2021 at 02:32 PM.
and now i can launch matlab from terminal, but not from dmenu, where matlab appears but does not launch from there.What could be the issue in the last case?
I assume you mean dmenu_run?
In any case, it's possible that your PATH export is not (yet) applied globally.
That would require a) putting it in the appropriate file - one that's sourced at login - and b) log out/in.
.zshrc is for zsh what .bashrc is for bash. They are run if an interactive non-login shell starts.
/etc/profile and its fragments in /etc/profile.d/ are common to zsh, bash, ksh, dash, ash, psh, sh, and to all users on the system.
They are run by login shells; some distros provide code to also run them by interactive non-login shells (and provide a flag variable that ensures they are run once).
Distribution: Linux(Redhat,fedora,suse,ubantu), Solaris (s8/s9/s10/nevada/open-solaris)
Posts: 303
Rep:
You might change default shell to /bin/bash for your user-id inside /etc/passwd. After that .bashrc env parameters will be taken care by your shell(bash).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.