Install matlab on linux without gui

340 views (last 30 days)
Eric Lundgren
Eric Lundgren on 26 Jan 2022
Commented: Chris Rorden on 1 Sep 2023
Hi,
The last week I've spent lots of time debugging (and searching through) the forum for how to install matlab on ubuntu server VM (20.04.3 LTS (Focal Fossa).
Background
From what I can gather through various posts, the summary of what i need to do is
  1. Download matlab installer executable from a machine with internet access, run it and choose "Download without installing" and move the installer files to the server in question along with posting my servers MAC-address and activating a licence for it (basically follow what's in Download Products Without Installing - MATLAB & Simulink - MathWorks Nordic). For the record, i chose version 2021b.
  2. Copy the installer properties file (installer_input.txt) and add (amongst other things) my file installation key and the path to my licence file. as well. This is explained in (Install Noninteractively - MATLAB & Simulink - MathWorks Nordic). This guide is for windows but according to Colin Fraser (Staff) in How do I use the Silent Installer for MATLAB? - (mathworks.com)
I followed these steps and tried running the installer in the following ways (both as root and as my normal service account)
./install -fileInput input.txt
./install -mode silent -fileInput input.txt
./install -mode silent -fileInput ${PWD}/input.txt
With the following input.txt
fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx-xxxxx
agreeToLicense=yes
mode=silent # This was found on this forum so i tested it out.
licensePath=xxxxxxxxxxxxxxxxxx
destinationFolder=/usr/local/R2021
improveMATLAB=no
enableLNU=no # Tried both yes/no without success
lmgrFiles=yes # Tried both yes/no without success
Problems
As far as I know, I've done everything correct and as far as my understanding goes, multiple combinations of my attempts should have worked. Nevertheless I still ran into a few odd issues.
1. I was unable to reach the activation service. This is completely expected as my server does not have internet access but why would does the installer even attempt this? This installation method was suggested in the next steps of Download Products Without Installing - MATLAB & Simulink - MathWorks Nordic as what you should do if you do not have internet access.
(Jan 24, 2022 16:08:56) HTTP request failed, retry # 1
(Jan 24, 2022 16:08:56) Request timed out.
(Jan 24, 2022 16:09:18) HTTP request failed, retry # 2
(Jan 24, 2022 16:09:18) Request timed out.
(Jan 24, 2022 16:09:42) HTTP request failed, retry # 3
(Jan 24, 2022 16:09:42) Request timed out.
(Jan 24, 2022 16:10:10) HTTP request failed, retry # 4
(Jan 24, 2022 16:10:10) Request timed out.
(Jan 24, 2022 16:10:10) HTTP request was timedout.
(Jan 24, 2022 16:10:10) Activation Service Reachable? false
2. After (debugging quite a bit to find out which URL(s) the installer is even trying to reach) having opened up firewall access just to make some progress on the installer. I'm instead greeted with the following message.
terminate called after throwing an instance of 'framework::window::DisplayError'
what(): No display available.
Aborted
So at this point it appears the no gui, and no internet access installation method requires both a gui and internet access (1).
3. Of course this makes me suspicious as i refuse to believe that (1) is true. I then started changing input.txt to make some sanity tests. I for instance added.
destinationFolder=/tmp/foo.log
This option is even part of the installer_input.txt template so I figured if anything would work, it would be this. The log output kept going to /tmp/mathworks_<user>.log so basically this option doesn't appear to be read by the installer at all (and at this point, i suspect perhaps not the other ones either).
4. At this point I start questioning quite a lot so I started checking if the config file is even being used.
$ stat input.txt | grep Access | tail -n 1
Access: 2022-01-26 09:43:50.819147700 +0000
$ ./install -fileInput input.txt
terminate called after throwing an instance of 'framework::window::DisplayError'
what(): No display available.
Aborted
$ stat input.txt | grep Access | tail -n 1
Access: 2022-01-26 09:43:50.819147700 +0000
I also ran
watch -n 0.1 'lsof >> accesses.log'
While the installer was running and there it doesn't look like it's ever reading any txt file. To examplify this, i tested the following
./install -fileInput derp.txt
./install -derp derp.txt
all with the same outcome and no error messages that neither the flag nor the files exist.
In addition to this, I tried redownloading everything (to make sure nothing got corrupted) and running the installer in a docker container on a different machine with internet access for debugging purposes but it ended up with exactly the same result.
Summary
As you probably realize, I've spent a massive amount of time with this problem and I'm at this point completely stuck and don't see any way to make progress. I briefly looked through the install-script but to no avail.
Help is very much appreciated.
Kind regards,
Eric
  4 Comments
Francesco Saverio Marra
Francesco Saverio Marra on 4 Apr 2023
Dear Eric,
I have a similar experience, and the answer provided by Huynh Tru does not solve the problem. It seems really that at Mathworks no much experience is present about the use of HPC servers and the constraints that limits GUI on this type of computing architectures (at least those with a Linux OS). Furthermore, at any change of the version, the problems seems to add instead that solved.
In my case, I cannot access a GUI environment for the installation (R2023a on a Ubuntu 22.03 LTS) because the HPC architecture provides a minimal environment to install applications to be shared with the nodes of the whole cluster, nodes that obviously do not have GUI support. It has to be this way. The frustration increases because when I try all the solutions suggested, the install scripts runs but it exits after a while doing nothig, even not writing messages in the designated log file. So, it is very difficult to debug this problem.
Best regards,
Francesco
Chris Rorden
Chris Rorden on 1 Sep 2023
I have also had issues with Huyn Tru's solution. Can anyone suggest solutions or have experience with Octave for these applications?

Sign in to comment.

Answers (1)

Huynh Tru
Huynh Tru on 30 Mar 2022
This has always worked for me for a linux installation with the downloaded iso. YMMV and I have never tried any other method...
Adapt with your keys and license server. Example download R2022a_Linux.iso (to /dev/shm my case) , modify the path to the answer file (maybe add more products) and license file, and run the script.
[tru@sillage matlab]$ cat runme-2022a.sh
#!/bin/sh
_V=R2022a_Linux
PATH=/sbin:/usr/sbin:/usr/bin:/bin
set -e
set -u
[ -f /dev/shm/${_V}.iso ] && [ -f /c7/home/tru/sources/matlab/${_V}.txt ] && \
sudo mount -o loop /dev/shm/${_V}.iso /mnt && \
bash /mnt/install -mode silent -inputFile /c7/home/tru/sources/matlab/${_V}.txt
[tru@sillage matlab]$ cat /c7/home/tru/sources/matlab/R2022a_Linux.txt
destinationFolder=/c7/shared/matlab/R2022a
fileInstallationKey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
agreeToLicense=yes
mode=silent
licensePath=/c7/home/tru/sources/matlab/network.lic
product.MATLAB
[tru@sillage matlab]$ cat /c7/home/tru/sources/matlab/network.lic
SERVER licserv.some.where xxxxxxxxxxxx 27000
USE_SERVER

Categories

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

Products


Release

R2021b

Community Treasure Hunt

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

Start Hunting!