MATLAB 2020a No display available error on Ubuntu

조회 수: 79 (최근 30일)
Zheng Zhao
Zheng Zhao 2020년 3월 19일
댓글: Wei 2022년 11월 19일
I'm installing MATLAB 2020a on Ubuntu 18.04 LTS.
However when I execute in terminal with:
sudo bash install
I got error
No protocol specified
terminate called after throwing an instance of '(anonymous namespace)::DisplayError'
what(): No display available.
Aborted
For some reason it works without using sudo
bash install
But I have to use sudo, as I need to create matlab folder in /usr/local/
How should I solve this?
  댓글 수: 9
Frederik Aidt
Frederik Aidt 2020년 12월 15일
Works here also. Thanks!
Samuel Gray
Samuel Gray 2020년 12월 19일
편집: Samuel Gray 2020년 12월 20일
...just as well, the first time that I tried to install R2020b on CentOS8 using the standard sudo ./install it shagged the x11 configuration though admittely this is an AMD laptop with onboard AMD graphics...I reinstalled CentOS8 and now it won't even run sudo ./install. So the legacy installer seems to have finished without a problem...now if I can just actually start Matlab...
ah, so
this time I did not use sudo, just called the installer as a regular user...
still got an X glitch but only for a moment then the installer screen came up as usual.
./bin/glnxa64/install_unix_legacy -input_file=./custom_installer_input.txt
...but that won't let me install into /usr/local so sudo it is...and that won't launch the installer!
Back to regular user but installing Matlab to my home account, ok that works...
Wow it's downloading 1.241MB just for for the core Matlab code and 29 toolkits! I already have downloaded 277MB just to run the installer...must be a lot of elves running around at Mathworks writing code especially since there are so many more toolkits that I could not download with one trial license! There must be an entire business-school, engineering, computer-science and computer graphics school of stuff in Matlab now.
Anyway I am glad that this time the installer started (twice) using sudo without blowing-up the x window manager this time and forcing me t wipe & reinstall CentOS8. Which probably someone else could have fixed, but I gave up trying to fix it after a week and just started over.

댓글을 달려면 로그인하십시오.

답변 (3개)

Alejandro Verri
Alejandro Verri 2021년 2월 2일
편집: Alejandro Verri 2021년 2월 2일
Effectively, in order to create the folders /usr/local/ you must be superuser, but the installation can and should be done with your user and avoid some know issues using root accounts with X11 video. A simple way to install it is to create the installation folders in usr/local and then change its owner (or group), before running the installer
sudo mkdir /usr/local/MATLAB
sudo mkdir /usr/local/MATLAB/R2020a
sudo chown YOUR_USERNAME /usr/local/MATLAB
sudo chown YOUR_USERNAME /usr/local/MATLAB/R2020a
./install
When the installer asks you if it should create symlinks in /usr/bin, simply change the destination to your local ~/Desktop or any other local folder and then, as superuser you just move those symlinks to the bin locations
sudo cp ~/Desktop/matlab /usr/bin
sudo cp ~/Desktop/mex /usr/bin
  댓글 수: 1
Alejandro Lorite Mora
Alejandro Lorite Mora 2021년 10월 8일
It worked for me, but the final step should be:
sudo cp ~/Desktop/matlab /usr/bin -P
sudo cp ~/Desktop/mex /usr/bin -P

댓글을 달려면 로그인하십시오.


Yuval Zukerman
Yuval Zukerman 2021년 2월 1일
The response from Philippe Dreesen appears to be working:
Open a terminal as regular user and execute "xhost +" to allow connections to the user's X11 server
user@computer $ xhost +
>> access control disabled, clients can connect from any host
Then open a terminal as root and export the DISPLAY and run the installer:
root@computer # export DISPLAY=:0.0
root@computer # ./install
I was also able to install using:
sudo ./install
  댓글 수: 1
Wei
Wei 2022년 11월 19일
Hi, Dear Yuval.
i had a simiar proble, but when i try to excute the ./install or sudo ./install, it jump a blank window like this. do you know any way to fix this? Thanks

댓글을 달려면 로그인하십시오.


Nick Warren
Nick Warren 2020년 11월 10일
Didn't work for me, presumably as I was SU'ing in as root, rather than logging in directly as root. This worked for me:
user@myserver:~$ xauth list
myserver/unix:11 MIT-MAGIC-COOKIE-1 27fbcf94c244d6946e39bd7a11d41453
myserver/unix:10 MIT-MAGIC-COOKIE-1 b00729a0755ddefa14a8fae6c677efd3
user@myserver:~$ echo $DISPLAY
localhost:10.0
user@myserver:~$ sudo su --login root
root@myserver:~# export DISPLAY=':10.0'
Add magic cookie for matching display - 10 in this case:
root@myserver:~# xauth add myserver/unix:10 MIT-MAGIC-COOKIE-1 b00729a0755ddefa14a8fae6c677efd3
Run the installer:
root@myserver:~# ~/path-to-matlab-installer/install
  댓글 수: 2
Zeeshan Nadir
Zeeshan Nadir 2022년 9월 23일
Worked like a charm. Thanks so much.
Herman Wong
Herman Wong 2022년 10월 8일
Awesome. Works like a charm instead of 'xhost +SI:localuser:root' solution others referring to.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by