ubuntu server 22.04 (无图形界面命令行安装matlab)静默安装matlab2022b
请设置她的昵称
编辑于 2023年10月11日 00:35
收录于文集
共1篇
  • Matlab安装文件准备     1)  安装包:R2022b_Linux.iso     2)  破解文件:Crack.zip

  • 解压破解文件

代码块
Shell
自动换行
复制代码
# 查看破解文件和安装包
user@server32:~$ ls
Crack.zip  R2022b_Linux.iso

# 解压缩破解文件
user@server32:~$ unzip Crack.zip
Archive:  Crack.zip
  inflating: libmwlmgrimpl.so
  inflating: license.lic

#破解文件必须包含这两个libmwlmgrimpl.so  license.lic
user@server32:~$ ls
Crack.zip  libmwlmgrimpl.so  license.lic  R2022b_Linux.iso
复制成功

  • 挂载安装包

代码块
Shell
自动换行
复制代码
# 创建一个空文件夹,用于挂载ISO
user@server32:~$ mkdir matlab_installer
# 查看下
user@server32:~$ ls
Crack.zip  libmwlmgrimpl.so  license.lic  matlab_installer  R2022b_Linux.iso

# 挂载ISO
user@server32:~$ sudo mount -o loop R2022b_Linux.iso matlab_installer
mount: /home/user/matlab_installer: WARNING: source write-protected, mounted read-only.
复制成功
  • 复制安装包中的 installer_input.txt 到 用户目录,修改权限并编辑它

代码块
Shell
自动换行
复制代码
user@server32:~$ sudo cp matlab_installer/installer_input.txt ./
user@server32:~$ sudo chmod 777 installer_input.txt
#安装位置: destinationFolder=/usr/local/matlab
#激活码: fileInstallationKey=
#同意协议:agreeToLicense=yes
#日志文件:outputFile=/home/user/matlabinstaller.log
#设置为静默模式: mode=silent
#*.lic文件文职: licensePath=~/license.lic
user@server32:~$ vim installer_input.txt
复制成功

installer_inpu.txt 文档内容如下(...为省略内容):

代码块
Shell
自动换行
复制代码
...
## SPECIFY INSTALLATION FOLDER
##
## Example:
##        (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX
##        (Linux) destinationFolder=/usr/local/RXXXX
##        (macOS) destinationFolder=/Applications
##
## Set the desired value for destinationFolder and
## uncomment the line.

# 安装路径
destinationFolder=/usr/local/matlab

##
## SPECIFY FILE INSTALLATION KEY
##
## Example: fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx.....
##
## Set the desired value for fileInstallationKey and
## uncomment the line.
##
# 激活码
fileInstallationKey=05322-36228-06991-12654-51812-34369-14072-44298-22786-36732-05503-35033-50900-29808-05166-12170-05630-02560-02687-62114-45079-42917-06281-13007-19512-18270

##
## ACCEPT LICENSE AGREEMENT
##
## You must agree to the license agreement to install MathWorks products.
## The license agreement can be found in the license_agreement.txt file at the
## root level of the installation DVD.
##
## Example: agreeToLicense=yes
##
## Set agreeToLicense value to yes or no and
## uncomment the line.
# 同意协议
agreeToLicense=yes
##
## SPECIFY OUTPUT LOG
##
## Specify full path of file into which you want the results of the
## installation to be recorded.
##
## Example:
##            (Windows) outputFile=C:\TEMP\mathworks_<user_name>.log
##            (Linux/macOS) outputFile=/tmp/mathworks_<user_name>.log
##
## Set the desired value for outputFile and
## uncomment the line.

# 日志文件,您自定义一个即可
outputFile=/home/user/matlabinstaller.log

mode=silent
# 您的lic文件所在位置
licensePath=/home/user/license.lic

...
复制成功
  • 安装

代码块
Shell
自动换行
复制代码
# 安装命令
user@server32:~$ sudo ./matlab_installer/install -inputFile installer_input.txt
复制成功
  • 等待安装完成

代码块
Shell
自动换行
复制代码
# 进入安装路径,能进入,有文件安装成功
user@server32:~$ cd /usr/local/matlab
user@server32:/usr/local/matlab$ ls
appdata  bin  cefclient  derived  examples  extern  help  interprocess  java  license_agreement.txt  mcr  patents.txt  platform  polyspace  remote  resources  rtw  runtime  simulink  sys  toolbox  trademarks.txt  ui  VersionInfo.xml
复制成功
  • 复制激活文件libmwlmgrimpl.so到安装位置下的bin/glnxa64/matlab_startup_plugins/lmgrimpl

代码块
Shell
自动换行
复制代码
user@server32:~$ sudo cp libmwlmgrimpl.so /usr/local/matlab/bin/glnxa64/matlab_startup_plugins/lmgrimpl/
复制成功
代码块
Shell
自动换行
复制代码
user@server32:~$ matlab
MATLAB is selecting SOFTWARE OPENGL rendering.

                                                                                   < M A T L A B (R) >
                                                                         Copyright 1984-2022 The MathWorks, Inc.
                                                                         R2022b (9.13.0.2049777) 64-bit (glnxa64)
                                                                                     August 24, 2022

 
To get started, type doc.
For product information, visit www.mathworks.com.
 
>> a=[1,2]

a =

     1     2

>> 
复制成功