I'm installing matlab on node6, which runs an OS of ubuntu20.04.1-server and has no GUI.
There's few guide on installing matlab on linux without gui, and I'm still trying.
Just to record my steps to review later.
- get iso file from school's genuine software
- use
sftp
to transfer the iso file to node6(a remote linux server)
under the path:$HOME/opt
- mount the iso:
sudo mkdir -p /media/matlab
sudo mount -o ro,loop ./R2021a_Linux.iso /media/matlab
- run the install script
sudo bash /media/matlab/install
but met problems:
terminate called after throwing an instance of '(anonymous namespace)::DisplayError'
what(): No display available.
- install x11 tools
sudo apt install x11-xserver-utils
- allow x11 forwarding
sudo vim /etc/ssh/sshd_config
# set
# X11Forwarding yes
sudo vim /etc/ssh/ssh_config
# set
# ForwardX11 yes
# ForwardX11Trusted yes
- add x11 host
export DISPLAY='127.0.0.1:0.0'
xhost +
# and met error:
xhost: unable to open display "127.0.0.1:0.0"
exit and ssh with -X:
ssh -X ella717@<host-ip>
or
ssh -Y ella717@<host-ip>
so the problem of x11 is not solved...
helpful guide links:
github-blog-on-how-to-install-matlab-without-gui
zhihu-guide
- make a new directory for matlab's license
sudo mkdir -p /usr/local/matlab/R2021a/license
- copy the license file to it
sudo cp -P $HOME/opt/2021a_activate/network.lic /usr/local/matlab/R2021a/liscense/.
- modify the inputFile
sudo cp -P /media/matlab/installer_input.txt /usr/local/matlab
sudo chmod 666 /usr/local/matlab/installer_input.txt
sudo vim /usr/local/matlab/installer_input.txt
# the /usr/local/matlab/installer_input.txt file:
destinationFolder=/usr/local/matlab/R2021a
fileInstallationKey=xxxxxxxx
agreeToLicense=yes
outputFile=/tmp/mathworks_install_ella717.log
enableLNU=yes
improveMATLAB=yes
licensePath=/usr/local/matlab/R2021a/license/network.lic
# be sure to uncomment the line!
- install with modified inputFile
sudo bash /media/matlab/install -inputFile /usr/local/matlab/installer_input.txt
- make alias and set the path
export PATH=$PATH:/usr/local/matlab/R2021a/bin
alias matlab="matlab -nodesktop -nodisplay"
- and the same problem remains...
-to be continued-