matlab won't start on Ubuntu 20.04

235 views (last 30 days)
Xujin Liu
Xujin Liu on 20 Aug 2021
Answered: Ruoshui Liu on 19 Mar 2022
When I run the matlab command, nothing pops up and a process is created. It uses 100% CPU but almost no memory. Tried 2021a, 2020b but both have the same issues.
Tried solutions:
  1. sudo chown xxx -R ./matlab
  2. sudo apt-get intsall matlab-support: the installation seems to require execution of matlab command - whenever I try to install, it hangs because matalb command is not responding - I'll need to end the matlab command manually and the installation will continue. Doesn't seem to work even with it installed.
  3. Removing preferences
What would be something else to try? Thank you.
  1 Comment
pan zheng
pan zheng on 22 Dec 2021
So sad that I got the same problem as you mention above.
no matlab window but a process named MATLAB running in background.
Have you find in which the problem lying?

Sign in to comment.

Answers (2)

Ruoshui Liu
Ruoshui Liu on 19 Mar 2022
What error message did you get?
If you see the following error while starting MATLAB from Ubuntu 20.04 terminal:
"Unexpected error during communication with services required to run MATLAB."
Then, here are some things you can try:
1. Launch the MATLAB for the first time
2. Invoke the command from your terminal
$ps aux | grep MathWorks
3. Look for the process "MathWorksServiceHost", and note the process ID
4. Kill that process
5. Launch the MATLAB again
6. You would see the Keyring dialog popping up, then you type in your password
7. MATLAB should launch
Have a go with this, and hope it helps you.

Rishik Ramena
Rishik Ramena on 23 Aug 2021
If you are having trouble starting MATLAB on a UNIX-based system and you are not receiving license manager related errors, your start up problems may be resolved by performing the following steps:
Solution #1: Remove Preferences
Remove your preferences directory, so that it can be recreated cleanly:
1. Open the Terminal Application (usually found in Applications or Utilities).
2. In the terminal window and run the following commands:
cd ~/.matlab
3. Once in the .matlab folder, delete the folder for the version of MATLAB you have. For example, if you have R2015a, run the command:
rm -rf R2015a
NOTE: Do not remove any folder that ends with "_licenses."
4. Once cleared, restart MATLAB. The preferences should be recreated.
On some distributions, launching MATLAB with sudo will create MATLAB preferences in your home folder that are owned by root. You will then not able to launch MATLAB as a standard user as MATLAB will not be able to read it's own preferences.
Solution #2: Move Working Directory
If the above solutions do not work, 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: Disable SELinux, AppArmor or other security software:
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)
To disable AppArmor on newer Ubuntu versions, run the below as root:
invoke-rc.d apparmor kill
update-rc.d -f apparmor remove
Once disabled, try MATLAB again. If it works, see the Related Solution at the bottom of the page:
"Why do I receive errors relating to the file "libmwlapack" when starting MATLAB R14SP3 or higher on Linux?"
Note: You may also have to reset the permissions on the folder you are trying to install from. Run the following command to modify the permissions:
chmod -R 755 $installfolder
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/R2015a/bin for R2015a.
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. 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.
Even if you intend to run MATLAB only in non-graphical mode, MATLAB requires some X11 libraries to run. 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:
If you are still unable to launch MATLAB on Linux after trying these troubleshooting steps, please contact the Installation & Licensing Support team:
  3 Comments
Xujin Liu
Xujin Liu on 23 Aug 2021
My installation could successfully open the first time it was installed, but can't open after rebooting once. Reinstalling after that doesn't help. So I should contact mathworks support for this?
Rishik Ramena
Rishik Ramena on 23 Aug 2021
Hi Xujin, yeah I had seen that and wanted to make sure that you're doing it the right way. And this post contains other solutions which you can try and if none of them works out, reach out to the Installation and Licensing Support team.

Sign in to comment.

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2021a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!