How to install Matlab without GUI

If you want to install Matlab in a server, probably you don't have a GUI.

To run the installer you need previosly configurate silent mode:

./install -mode silent
Preparing installation files ...
Installing ...
(Nov 03, 2016 10:53:02) ##################################################################
(Nov 03, 2016 10:53:02)
(Nov 03, 2016 10:53:03) When running the installer with an input file, you must accept the license agreement by setting the agreeToLicense option to yes.
(Nov 03, 2016 10:53:03) Exiting with status -2
(Nov 03, 2016 10:53:07) End - Unsuccessful.

The previous error is because we need configurate all options, like if you are agree with the license agreement, enter the licence key, etc.
To do this, you need to edit installer_input.txt and activate.ini files:

In activate.ini these are the lines that you need configurate:

isSilent=true
activateCommand=activateOffline
licenseFile=/root/Matlab_R2016a_glnxa64.lic

In installer_input.txt these are:

agreeToLicense=yes
fileInstallationKey=09806-07443-53955-64350-21751-41XXX
destinationFolder=/usr/local/R2016a

Now, execute the installer with installer_input options:

./install -inputFile ~/installer_input.txt

At the end of the instalation you will see the following message:

MATLAB Compiler SDK 6.2 requires the following: 

?  a supported compiler for creation of C and C++ Shared libraries
?  a Java JDK for creation of Java packages

(Nov 03, 2016 11:15:54) Exiting with status 0
(Nov 03, 2016 11:15:56) End - Successful.
Finished

To avoid problems, is better install them:

apt-get install gcc build-essential openjdk-7-jdk

Now, to activate matlab, if you run activate_matlab.sh you will see the following error:

./activate_matlab.sh 
---------------------------------------------------------------------------
Error: Activation cannot proceed. You may either:
1. Set an X11 display, and restart the activation process
2. Use the silent activation feature

3. Activate using the license center

To solve it, you must use activation.ini file as parameter:

./activate_matlab.sh -propertiesFile ~/activate.ini 
Silent activation succeeded.

To run matlab, now you need run it wihout interface:

matlab -nodesktop -nojvm -nosplash
#or matlab -nodisplay

If you want run matlab easily, you can add to your ~/.bashrc file the following lines:

alias matlab='matlab -nodisplay'
MATLAB='/usr/local/R2016a/bin'
PATH=$MATLAB:$PATH

If you need remove matlab form your computer, just run these:

rm -rf /usr/local/R2016
rm ~/.matlab
rm /usr/local/bin/matlab /usr/local/bin/mcc /usr/local/bin/mex /usr/local/bin/mbuild

After that, check for any matlab files with:

updatedb
locate matlab

Enjoy it!

Comments

  1. Didn't work for me. On activation it says "Silent activation succeeded.", but when I execute "matlab -nodesktop -nojvm -nosplash" it returns:

    Error: Activation cannot proceed. You may either:
    1. Set an X11 display, and restart the activation process
    2. Use the silent activation feature
    3. Activate using the license center

    ReplyDelete
  2. Much thanks ! This post helped me lots.
    Btw, I was trying to install matlab in a docker container.

    ReplyDelete
  3. Hi,
    Good job & thank you very much for the new information, i learned something new. Very well written. It was sooo good to read and usefull to improve knowledge. Who want to learn this information most helpful. One who wanted to learn this technology IT employees will always suggest you take python training in bangalore. Because Python course in Bangalore is one of the best that one can do while choosing the course.

    ReplyDelete

Post a Comment

Popular posts from this blog

Exception: Could not find a default OpenFlow controller in Mininet

How to fix Android when developer options are not available for this user

v4l2: open /dev/video0: Permission denied