Why does MATLAB fail to install with a "'std::runtime_error' what(): Unable to launch the MATLABWindow application" error on Linux?

996 views (last 30 days)
When I try to install MATLAB on Linux, it fails with the following error:
terminate called after throwing an instance of 'std::runtime_error'
what(): Unable to launch the MATLABWindow application
Aborted

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 23 Mar 2022
Edited: MathWorks Support Team on 23 Mar 2022
For MATLAB R2021a or later:
This error typically occurs as the result of a CEF issue from missing libraries. You can directly run the MATLABWindow script from within the MathWorks Product Installer for a potentially more detailed error message on the missing libraries. You can run MATLABWindow directly by following the below instructions:
1) Start a terminal
2) Extract the MathWorks Product Installer (ex. matlab_R2021b_glnxa64.zip) to a new directory
3) cd to the extracted installer directory (i.e. the directory from which they would run ./install)
4) Run the following command
  ./bin/glnxa64/MATLABWindow
 
An example output from this would be:
./bin/glnxa64/MATLABWindow: error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory
In the above example, the issue was resolved by installing the at-spi2-atk library package.
Another example output is:
./bin/glnxa64/MATLABWindow: error while loading shared libraries: libasound.so.2: cannot open shared object files: No such file or directory.
In this example, the issue was resolved by installing the alsa-lib and alsa-lib-devel library packages.
For MATLAB R2020b or earlier:
This error message is typically caused by a library dependency error.
To resolve this issue, please remove the following libraries from the MathWorks Installation files, specifically the /bin/glnxa64 directory:
libcrypto.so.1.1
libssl.so.1.1
  22 Comments

Sign in to comment.

More Answers (8)

Tianjiao Ding
Tianjiao Ding on 3 Aug 2020
In fact this solution seems to work so well that I would like to make it an answer rather than a comment to help those who suffer from this problem. I am using ssh to connect a remote machine, and on the remote machine I am root.
  1. Turn on X11-forwarding to have remote display. This is a must if you do not want to install without GUI (where I tried for 15 mins to look for the so-called "File installation key" and gave up). Then ssh -Y or ssh -X to the remote machine.
  2. Install by directly running "install_unix_legacy". For me it is located at MATLAB2020a/bin/glnxa64/install_unix_legacy, but it may be different for you if you are using different architectures/operating systems.
  3. If 2 does not work, try runing "install_unix".
  4. Now a window for installation should pop up. Cheers!
I did not delete any of the files mentioned by the other answers. If you want to try, remember to delete not only the indicated files, but also their symbolic links in the same directory.
  14 Comments
cui
cui on 23 Sep 2022
@Elizabeth Sarneso good job,this is the first time I've heard of a successful installation on WSL2, congratulations, I'll try to install on WSL2 in the future, win11 supports the WSL2-GUI interface, a screenshot of matlab would be nice

Sign in to comment.


Jeffrey Daniels
Jeffrey Daniels on 10 Dec 2020
Edited: Jeffrey Daniels on 10 Dec 2020
I had this same problem. I didn't need to use 'install_unix_legacy' or remove any libraries. This is how I fixed it:
Ensure that you have permission to read and execute in the folder you are running ./install from, because the installation program needs to stat files in that folder structure; /home/[user]/MatlabR2020b_Linux_Install/bin/glnxa64/cef_locales/ to be specific, among others.
$ chmod 755 -R /home/[user]/MatlabR2020b_Linux_Install/
$ sudo ~/MatlabR2020b_Linux_Install/install
  3 Comments

Sign in to comment.


xiangxin Zhao
xiangxin Zhao on 5 Nov 2021
just need install xfce4 and then remove it,but i don't konw why...maybe need some package?
sudo apt install xfce4
sudo apt remove xfce4

René Magritz
René Magritz on 27 Jul 2021
For me, it was libnss3, which was missing. Installing it fixed the issue for me.

Yu Jiang
Yu Jiang on 5 Nov 2020
I'm also having this problem, on ubuntu 20.10, and removing libcrypto.so.1.1 and libssl.so.1.1 did not resolve the problem. I'm still getting the same error
terminate called after throwing an instance of 'std::runtime_error'
what(): Unable to launch the MATLABWindow application
Aborted (core dumped)
  2 Comments
Colin Fraser
Colin Fraser on 11 Nov 2020
Edited: Colin Fraser on 11 Nov 2020
Using the legacy installer is not a qualified workflow. If you are experiencing any issues installing MATLAB and the steps outlined in the article above do not help, please contact MathWorks Install Support https://www.mathworks.com/company/aboutus/contact_us.html.
-Colin Fraser

Sign in to comment.


RASHAD AHMED
RASHAD AHMED on 16 Dec 2020
The default installer required some dependencies not found on a vanilla minimal RHEL based distro. Neither the installer nor the legacy installer opened correctly. The default installer successfully ran after installing the following packages:
yum install libX11 libXcomposite libXcursor libXdamage libXext libXfixes libXft libXi libXrandr libXrender libXScrnSaver libXt libXtst libXxf86vm alsa-lib atk cairo cups-libs fontconfig GConf2 gtk2 gdk-pixbuf2 gnome-vfs2 gstreamer1-plugins-base gstreamer1 pango libsndfile libxcb libxslt
These packages were the requirements for MCR, but it helped resolve the installation for default MatLab (R2020b) nonetheless. https://www.mathworks.com/matlabcentral/answers/358052-is-there-a-list-of-matlab-runtime-dependencies
  1 Comment
Laura Morris
Laura Morris on 5 Jan 2021
I'm running a fresh install of RHEL 8 and MATLAB R2020b wouldn't install. Error exactly as in the title. I tried removing libcrypto.so.1.1 and libssl.so.1.1 (didn't work). I tried the Jeffrey Daniels solution (also didn't work). I tried Rashad Ahmed's package installation, and that's where I found a problem. Everything was already installed EXCEPT "gnome-vfs2", which is "not included" in RHEL 8 according to Red Hat documentation. So then I tried Tianjiao Ding's "install_unix_legacy" method. THAT WORKED! This all started because I was trying to test a stand alone app being created by a coworker (which uses Runtime R2020a). I couldn't get the app to start. But that may be another issue. This only fixed the MATLAB installation issue.

Sign in to comment.


Erick Bezerra
Erick Bezerra on 30 Apr 2021
I had the same error, tried almost everything from here, and the right one was the "sudo ./install_unix_legacy"
Matlab R2020a
Ubuntu 20.10
  1 Comment
Colin Fraser
Colin Fraser on 12 May 2021
Using the legacy installer is not a qualified workflow. If you are experiencing any issues installing MATLAB and the steps outlined in the article above do not help, please contact MathWorks Install Support https://www.mathworks.com/company/aboutus/contact_us.html.
-Colin Fraser

Sign in to comment.


David Schiller
David Schiller on 19 Aug 2021
I have a good procedure to fix this, after trying many many things. Instead of trying to run /bin/install_unix or whatever, try running /bin/MATLABWindow directly. When I did this, I received this error:
./MATLABWindow: error while loading shared libraries: libgdk_pixbuf-2.0.so.0: cannot open shared object file: No such file or directory
I then used my package manager to install this missing package (apt-get install librust-gdk-pixbuf-sys-dev)
Then, I continued to run MATLABWindow which now threw a different error about a different library, and installed that. I continued for about 5 total packages, and then finally running MATLABWindow popped up a graphical window like you would hope.
At this point, you just close that window and run the normal install script. Worked perfectly for me.

Tags

No tags entered yet.

Community Treasure Hunt

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

Start Hunting!