MATLAB 2020a No display available error on Ubuntu
81 次查看(过去 30 天)
显示 更早的评论
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 个评论
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
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
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
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 个评论
Herman Wong
2022-10-8
Awesome. Works like a charm instead of 'xhost +SI:localuser:root' solution others referring to.
Yuval Zukerman
2021-2-1
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
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
另请参阅
类别
在 Help Center 和 File 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!