[SOLVED] Can not set PATH permanently in order to launch MATLAB system wide 15 January 2021, 17:54:31 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:i) PATH=$PATH:/usr/local/MATLAB/R2018a/bin export PATHIf i check with echo PATH it schows the directory, but after reboot the directory is not in PATH anymore.ii) As the before method failed i edited ~/.bashrc:export MATLAB_HOME=/usr/local/MATLAB/R2018a/binexport PATH=$PATH:$MATLAB_HOMEthen i source the file. If i check with echo PATH it schows the directory, but after reboot the directory is not in PATH anymore.iii) The last method failed too, so i edited ~/.config/shell/profilethe same result as before.Can anybody tell what i am doing wrong? I am new to artix runit so maybe i made a big mistake. Thanks in advance! Last Edit: 03 February 2021, 22:18:11 by nous
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #1 – 15 January 2021, 19:46:11 try put your PATH environment variable to /etc/profile.d
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #2 – 16 January 2021, 00:20:54 Thanks for the answer. But how should i do it? I guess that i have to create a sh script, but how should i name it? Or this is of no relevance?
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #3 – 16 January 2021, 11:43:26 look the another *.sh files in etc/profile.dcreate new file.sh and put in to your "export MATLAB_HOME=/usr/local/MATLAB/R2018a/binexport PATH=$PATH:$MATLAB_HOME" after reboot or "source /etc/profile.d/yournewfile.sh" should it works
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #4 – 16 January 2021, 15:12:05 Reading /etc/profile is helpful too. You can use append_path '/some/path' too, as explained in /etc/profile. In /etc/profile.d as well as the .sh files read by /etc/profile I have some .csh files provided by some installed packages, that appear to be used when you are using csh instead of BASH, so the name may vary if you are using a different shell.There also seems to be an inconsistent feature here:/etc/profile.d/locale.sh is owned by filesystem 2020.09.03-1First line:#!/bin/shThe shebang isn't required with the current set up. If it's there for compatibility with other shells, then other files are missing this. I suppose it's treated as a comment in this usage and ignored.
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #5 – 16 January 2021, 17:28:43 First line:#!/bin/sh[/quote]none of profiles.d/*.sh files use #!/bin/sh, so do not add it !
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #6 – 17 January 2021, 03:16:01 Except this one - which probably has not been looked at for some time https://gitea.artixlinux.org/packagesF/filesystem/src/branch/master/x86_64/core/locale.sh
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #7 – 18 January 2021, 16:06:06 Hi, thanks for your help. Alium, your sugestion was thw solution. Now the matlab's executable directory is in $PATH permanently and can launch from terminal from any location. But some issue persists... If i try to launch from dmenu (i have dwm wm) it appears in the menu but can't launch. What could be the problem in this case?
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #8 – 18 January 2021, 16:41:25 maybe some wrong path set in /usr/share/applications/matlab.desktop ? (i don't know dmenu/dwm - never used that, so i just guess) can you find out where dmenu gets instructions on what to run? it should use /usr/share/applications/matlab.desktop too (i guess)did you use this source? https://aur.archlinux.org/packages/matlab/
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #9 – 19 January 2021, 19:57:27 Alium, i will give a try to your suggestion. The strange thing is that if i put in dmenu matlab -desktop, it works.
Re: Can not set PATH permanently in order to launch MATLAB system wide Reply #10 – 03 February 2021, 17:44:56 Hi to all,I found that from dmenu i have to write Code: [Select]matlab -desktop in order to launch matlab from there. So i thimk that this post can be considered as solved. Many thanks to all for your help.