Ubuntu Server 14 安装 Matlab2014的问题

随笔 2017-06-10

环境:Ubuntu Server14.04,Matlab版本2014a,请提前配置java环境。

1.将下载好的安装文件解压之后成为一个安装镜像

捕获.png

并上传到服务器。

2.使用 mount -o loop [filename].iso /media/cdrom 挂载安装镜像,这里要在root权限下执行,media下的挂载位置可以自定义。执行后输出是mount: block device /home/chenfei/matlab/Mathworks.Matlab.R2014a.Unix.iso is write-protected, mounting read-only

3.进入挂载目录,运行安装命令,由于服务器没有图形界面,因此要在silent模式下安装,注意,如果直接执行sudo ./install -mode silent 是无法完成安装的,报错 When running the installer with an input file, you must accept the license agreement by setting the agreeToLicense option to yes.。按照网上的做法,新建activate.ini文件并执行 ./install -mode silent -fileInstallationKey 29797-39064-48306-32452 -agreeToLicense yes -activationPropertiesFile /home/activate.ini -destinationFolder /usr/local/MATLAB/R2014a 命令,报错是 When running the installer with an input file, you must specify the full path to a license file using the licensePath option.

4.正确的做法是将licence文件放到任意目录,然后执行sudo ./install -mode silent -agreeToLicense yes -fileInstallationKey 29797-39064-48306-32452 -licensePath /[path]/license.lic

此时输出:

Preparing installation files ...
Installing ...
(Jun 10, 2017 09:53:23) ##################################################################
(Jun 10, 2017 09:53:23) #
(Jun 10, 2017 09:53:23) # Today's Date:
(Jun 10, 2017 09:53:23) Sat Jun 10 09:53:23 CST 2017
(Jun 10, 2017 09:53:23)
(Jun 10, 2017 09:53:23) System Info
(Jun 10, 2017 09:53:23) OS: Linux 4.4.0-31-generic
(Jun 10, 2017 09:53:23) Arch: amd64
(Jun 10, 2017 09:53:23) Data Model: 64
(Jun 10, 2017 09:53:23) Language: en
(Jun 10, 2017 09:53:23) Java Vendor: Oracle Corporation
(Jun 10, 2017 09:53:23) Java Home: /tmp/mathworks_20117/sys/java/jre/glnxa64/jre
(Jun 10, 2017 09:53:23) Java Version: 1.7.0_11
(Jun 10, 2017 09:53:23) Java VM Name: Java HotSpot(TM) 64-Bit Server VM
(Jun 10, 2017 09:53:23) Java Class Path: .
(Jun 10, 2017 09:53:23) User Name: root
(Jun 10, 2017 09:53:23) Current Directory: /media/cdrom
(Jun 10, 2017 09:53:23) Input arguments:
(Jun 10, 2017 09:53:23) root /media/cdrom
(Jun 10, 2017 09:53:23) tmpdir /tmp/mathworks_20117
(Jun 10, 2017 09:53:23) mode silent
(Jun 10, 2017 09:53:23) agreeToLicense yes
(Jun 10, 2017 09:53:23) fileInstallationKey 29797-39064-48306-32452
(Jun 10, 2017 09:53:23) licensePath /home/license.lic
(Jun 10, 2017 09:53:23) standalone true
(Jun 10, 2017 09:53:24) Starting local product/component search
(Jun 10, 2017 09:53:24) Assembling product list...
(Jun 10, 2017 09:53:28) Completed local product/component search
(Jun 10, 2017 09:53:28) Installing Product: MATLAB Distributed Computing Server 6.4
(Jun 10, 2017 09:53:35) Installing Product: MATLAB 8.3
(Jun 10, 2017 09:53:54) Installing Product: Simulink 8.3
(Jun 10, 2017 09:54:01) Installing Product: Aerospace Blockset 3.13
(Jun 10, 2017 09:54:01) Installing Product: Aerospace Toolbox 2.13
(Jun 10, 2017 09:54:02) Installing Product: Bioinformatics Toolbox 4.4
(Jun 10, 2017 09:54:05) Installing Product: Communications System Toolbox 5.6
(Jun 10, 2017 09:54:20) Installing Product: Computer Vision System Toolbox 6.0
(Jun 10, 2017 09:54:33) Installing Product: Control System Toolbox 9.7
(Jun 10, 2017 09:54:40) Installing Product: Curve Fitting Toolbox 3.4.1
(Jun 10, 2017 09:54:48) Installing Product: Database Toolbox 5.1
(Jun 10, 2017 09:54:48) Installing Product: Datafeed Toolbox 4.7
(Jun 10, 2017 09:54:48) Installing Product: DO Qualification Kit 2.3
(Jun 10, 2017 09:54:49) Installing Product: DSP System Toolbox 8.6
(Jun 10, 2017 09:54:51) Installing Product: Econometrics Toolbox 3.0
(Jun 10, 2017 09:54:51) Installing Product: Embedded Coder 6.6
(Jun 10, 2017 09:54:52) Installing Product: Filter Design HDL Coder 2.9.5
(Jun 10, 2017 09:54:52) Installing Product: Financial Instruments Toolbox 1.3
(Jun 10, 2017 09:54:53) Installing Product: Financial Toolbox 5.3
(Jun 10, 2017 09:54:53) Installing Product: Fixed-Point Designer 4.2
(Jun 10, 2017 09:54:53) Installing Product: Fuzzy Logic Toolbox 2.2.19
(Jun 10, 2017 09:54:53) Installing Product: Global Optimization Toolbox 3.2.5
(Jun 10, 2017 09:54:54) Installing Product: HDL Coder 3.4
(Jun 10, 2017 09:54:55) Installing Product: HDL Verifier 4.4
(Jun 10, 2017 09:54:56) Installing Product: IEC Certification Kit 3.3
(Jun 10, 2017 09:54:58) Installing Product: Image Acquisition Toolbox 4.7
(Jun 10, 2017 09:54:59) Installing Product: Image Processing Toolbox 9.0
(Jun 10, 2017 09:55:19) Installing Product: Instrument Control Toolbox 3.5
(Jun 10, 2017 09:55:20) Installing Product: LTE System Toolbox 1.1
(Jun 10, 2017 09:55:20) Installing Product: Mapping Toolbox 4.0.1
(Jun 10, 2017 09:55:23) Installing Product: MATLAB Builder JA 2.3.1
(Jun 10, 2017 09:55:24) Installing Product: MATLAB Coder 2.6
(Jun 10, 2017 09:55:25) Installing Product: MATLAB Compiler 5.1
(Jun 10, 2017 09:55:48) Installing Product: MATLAB Production Server 1.2
(Jun 10, 2017 09:55:48) Installing Product: MATLAB Report Generator 3.16
(Jun 10, 2017 09:55:49) Installing Product: Model Predictive Control Toolbox 4.2
(Jun 10, 2017 09:55:49) Installing Product: Neural Network Toolbox 8.2
(Jun 10, 2017 09:55:50) Installing Product: Optimization Toolbox 7.0
(Jun 10, 2017 09:55:50) Installing Product: Parallel Computing Toolbox 6.4
(Jun 10, 2017 09:55:50) Installing Product: Partial Differential Equation Toolbox 1.4
(Jun 10, 2017 09:55:51) Installing Product: Phased Array System Toolbox 2.2
(Jun 10, 2017 09:55:51) Installing Product: Polyspace Bug Finder 1.1
(Jun 10, 2017 09:55:54) Installing Product: Polyspace Code Prover 9.1
(Jun 10, 2017 09:55:54) Installing Product: RF Toolbox 2.14
(Jun 10, 2017 09:55:55) Installing Product: Robust Control Toolbox 5.1
(Jun 10, 2017 09:55:56) Installing Product: Signal Processing Toolbox 6.21
(Jun 10, 2017 09:55:57) Installing Product: SimBiology 5.0
(Jun 10, 2017 09:55:57) Installing Product: SimDriveline 2.6
(Jun 10, 2017 09:55:58) Installing Product: SimElectronics 2.5
(Jun 10, 2017 09:55:59) Installing Product: SimEvents 4.3.2
(Jun 10, 2017 09:55:59) Installing Product: SimHydraulics 1.14
(Jun 10, 2017 09:56:00) Installing Product: SimMechanics 4.4
(Jun 10, 2017 09:56:18) Installing Product: SimPowerSystems 6.1
(Jun 10, 2017 09:56:19) Installing Product: SimRF 4.2
(Jun 10, 2017 09:56:20) Installing Product: Simscape 3.11
(Jun 10, 2017 09:56:21) Installing Product: Simulink 3D Animation 7.1
(Jun 10, 2017 09:56:22) Installing Product: Simulink Code Inspector 2.1
(Jun 10, 2017 09:56:22) Installing Product: Simulink Coder 8.6
(Jun 10, 2017 09:56:23) Installing Product: Simulink Control Design 4.0
(Jun 10, 2017 09:56:24) Installing Product: Simulink Design Optimization 2.5
(Jun 10, 2017 09:56:25) Installing Product: Simulink Design Verifier 2.6
(Jun 10, 2017 09:56:25) Installing Product: Simulink Report Generator 3.16
(Jun 10, 2017 09:56:26) Installing Product: Simulink Verification and Validation 3.7
(Jun 10, 2017 09:56:26) Installing Product: Stateflow 8.3
(Jun 10, 2017 09:56:27) Installing Product: Statistics Toolbox 9.0
(Jun 10, 2017 09:56:28) Installing Product: Symbolic Math Toolbox 6.0
(Jun 10, 2017 09:56:51) Installing Product: System Identification Toolbox 9.0
(Jun 10, 2017 09:56:52) Installing Product: SystemTest 2.6.7
(Jun 10, 2017 09:56:53) Installing Product: Wavelet Toolbox 4.13    
(Jun 10, 2017 09:57:01) Exiting with status 0
(Jun 10, 2017 09:57:01) End - Successful.
Finished

完成安装。

5.破解,matlab默认安装目录为/usr/local/MATLABlibmwservices.so覆盖

/usr/local/MATLAB/MATLAB_Production_Server/R2014a/bin/glnxa64/

下的文件:sudo cp libmwservices.so /usr/local/MATLAB/MATLAB_Production_Server/R2014a/bin/glnxa64/

6.运行matlab:/usr/local/MATLAB/MATLAB_Production_Server/R2014a/bin/matlab

这个时候发现输出:error while loading shared libraries: libXt.so.6: cannot open shared object file: No such file or directory

/usr/lib/i386-linux-gnu下查找,发现确实没有libXt.so.6。使用sudo apt-get install libxt6安装。

继续运行启动命令,输出 error while loading shared libraries: libXmu.so.6: cannot open shared object file: No such file or directory 同样的方法,查找并安装缺失的库sudo apt-get install libxmu-dev 再次启动输出:

----------------
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
---------------------------------------------------------------------------

还是需要激活。 进入到/usr/local/MATLAB/MATLAB_Production_Server/R2014a/bin 目录下。 使用./activate_matlab.sh -propertiesFile /[path]/activate.ini 激活。 activate.ini文件内容为:

  isSilent=true
  activateCommand=activateOffline
  licenseFile=/home/license.lic

提示:Silent activation succeeded. 注意:激活必须使用root权限,否则会失败。

再次运行./matlab 终于大功告成。 捕获.png

最后,为了方便使用,可以设置环境变量。

vi /etc/profile

在文件末尾添加

export PATH=/usr/local/MATLAB/MATLAB_Production_Server/R2014a/bin:$PATH

保存并退出后使设置生效

source /etc/profile

解除挂载:umount /media/cdrom (root)

以后直接输入matlab就可以使用了。


本文由 Tony 创作,采用 知识共享署名 3.0,可自由转载、引用,但需署名作者且注明文章出处。

如果对您有用,您的支持将鼓励我继续创作!