Why will MATLAB not start up properly on my Linux machine?

MathWorks Solution

If you are having trouble starting MATLAB on a Linux machine and you are not receiving license manager related errors, your start up problems may be resolved by performing the following steps:
Solution #1: Regenerate Preferences
Follow the steps in the article below to remove your preferences directory, so that it can be recreated cleanly:
Solution #2: Move Working Directory
Be sure that there are no files conflicting on your MATLAB path. To verify that your work files and/or startup.m files are not conflicting with this MATLAB installation, perform the following steps:
  1. Move the contents of your ~/Documents/MATLAB folder to another location on your computer.
  2. Start MATLAB again to see if the problem still occurs.
If this resolves the problem, one of your work files is likely conflicting with your MATLAB installation or your startup.m file is crashing MATLAB.
Solution #3: SELinux, AppArmor or Other Security Software:
Security software on Linux systems, such as AppArmor, SELinux, or other system-level protections, may restrict functionality required by MATLAB’s desktop components. This can cause MATLAB to fail to start or crash during launch, depending on system configuration.
AppArmor (common on Ubuntu and related distributions)
Test for AppArmor-related restrictions by running,
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
This change takes effect immediately but note that it resets after a reboot. When set, try launching MATLAB again.
SELinux (common on RHEL, CentOS, Rocky, etc.)
Try running MATLAB with SELinux disabled. SELinux may prevent MATLAB from starting. To temporarily disable it, run the following command as root:
/usr/sbin/setenforce 0
(/usr/sbin/setenforce 1 will turn SELinux back on)
If the issue appears to be related to security software, additional system configuration may be required. The steps above are intended only for testing and do not resolve the underlying cause. Contact your system administrator for further assistance.
Solution #4: Debugging Mode
Open MATLAB with the Desktop and Java options Disabled:
1. From the terminal, type the following:
cd $MATLABROOT/bin/
Where $MATLABROOT is the path to your root MATLAB directory)
By default this will be /usr/local/MATLAB/R2022b/bin for R2022b. 
2. Try launching MATLAB with each of the below commands:
matlab -nodesktop
matlab -nojvm
matlab -nodisplay
If MATLAB starts in either of these modes, there is most likely a Java issue. You can check to see if there is a MATLAB_JAVA environment variable that may be changing the JVM that MATLAB is using. If this variable exists, try removing it. 
If MATLAB fails to start in either of these modes, more information may be obtained from the MATLAB crash dump files. These files will be located in your home folder and will have the names:
~/matlab_crash_dump.XXX
~/java.log.XXX
~/hs_err_pid#.log
If any of these files exists, send those files along with the output of the commands above to the Installation and Licensing team using the form at the bottom of this article.
Solution #5: Missing Libraries
MATLAB is tested and fully qualified on Ubuntu, Debian, Red Hat Enterprise Linux (RHEL), and SuSE. However, it will still run on most popular distributions of Linux, provided it is a full desktop installation of the distribution. MATLAB is not supported on minimal or server distributions. A minimal installation may not contain all libraries that MATLAB requires. 
MATLAB requires some X11 libraries to run, regardless of whether graphics and UIs are used or not. However, we are not able to specify the X11 requirements down to the exact set of packages required because different distributions may package the libraries differently. MATLAB will work out of the box on desktop installations of any supported distribution. 
See the below for a list of qualified distributions:
Solution #6: Permissions Issues
If MATLAB does not have the correct permissions to certain files and folders, it may not launch or launch correctly. Make sure the user starting MATLAB has access to read and execute files from where MATLAB is installed.
Solution #7: Corrupt Cache
Sometimes, certain files are cached when using MATLAB. Try temporarily removing any temporary files or folders before launching MATLAB. 
Solution #8: Citrix Workspace Apps
Citrix Workspace Apps may have the file "/usr/local/lib/AppProtection/libAppProtection.​so". This file may be interfering with startup. Try removing/renaming the file, ensuring all MATLAB windows are closed, then attempt to launch MATLAB again.

Categories

Tags

No tags entered yet.

Did this resolve your question?

No