Linux 命令行安装matlab

1.安装准备

  • Matlab2019b安装文件:ios
  • Matlab2019b破解文件:crack
  • SSH登录Linux系统工具:Xshell和Xftp

2.安装过程

2.1安装文件

  • 通过Xftp将Matlab安装软件和破解软件上传到Linux服务器上
  • 如果可以使用管理员权限,可以直接加载IOS文件
mount -o loop R2019b_Linux.iso ~/software/matlab
  • 如果仅仅是普通用户,则需要7z进行解压缩
7z x R2019b_Linux.iso
  • 同样对crack进行解压缩,并移动或者复制到某一目录内

2.2 安装过程配置

  • 进入R2019_Linux.iso解压后的目录,将以下文件模式改为可运行
chmod +x ~/matlab2019b/install
chmod +x ~/matlab2019b/
chmod +x ~/sys/java/jre/glnxa64/jre/bin/java 
  • 回到上述解压后的目录,修改安装配置文件installer_input.txt
##################################################################
##
## Use this file to specify parameters required by the installer at runtime.
##
## Instructions for using this file.
##
## 1. Create a copy of this template file and fill in the required
##    information.
##
## 2. Uncomment only those lines that start with a single '#'
##    and set the desired values. All allowed values for the
##    parameters are defined in the comments section for each
##    parameter.
##
## 3. Launch the installer from the command line, using the -inputFile option
##    to specify the name of your installer initialization file.
##
##    (Windows) setup.exe -inputFile <file_name>
##    (Mac/Unix) install -inputFile <file_name>
##
## NOTE:
##    If you want to run the activation application in silent
##    mode immediately after the installer completes, you must create
##    an activation initialization file and specify its name as the
##    value of the activationPropertiesFile= option. You can also
##    pass the name of the activation initialization file to the
##    installer using the -activationPropertiesFile command line
##    option.
##
##################################################################
##
##
## SPECIFY INSTALLATION FOLDER
##
## Example:
##        (Windows) destinationFolder=C:\Program Files\MATLAB\RXXXX
##        (Unix) destinationFolder=/usr/local/RXXXX
##        (Mac) destinationFolder=/Applications
##
## Set the desired value for destinationFolder and
## uncomment the line.

destinationFolder='~/matlab'(软件安装目录,注意目录和文件权限)

##
## SPECIFY FILE INSTALLATION KEY
##
## Example: fileInstallationKey=xxxxx-xxxxx-xxxxx-xxxxx.....
##
## Set the desired value for fileInstallationKey and
## uncomment the line.
##

fileInstallationKey=09806-07443-53955-64350-21751-41297(激活码)

##
## 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
##            (Unix/Mac) outputFile=/tmp/mathworks_<user_name>.log
##
## Set the desired value for outputFile and
## uncomment the line.

# outputFile=(安装过程日志,可以不填)

## SPECIFY INSTALLER MODE
##
## interactive: Run the installer GUI, waiting for user input on all
##              dialog boxes.
##
## silent:      Run the installer without displaying the GUI.
##
## automated:   Run the installer GUI, displaying all dialog boxes, but only
##              waiting for user input on dialogs that are missing required
##              input.
##
## Set mode value to either interactive, silent, or automated and
## uncomment the line.

mode=silent(静默安装,不弹出GUI交互界面)

## SPECIFY LENGTH OF TIME DIALOG BOXES ARE DISPLAYED
##
## Specify how long the installer dialog boxes are displayed, in milliseconds.
##
## NOTE: Use this value only if you set the installer mode to automated.
##
## By default, the dialog boxes display on the screen for one second.
##
## Example: (To specify a value of 1 second.) automatedModeTimeout=1000
##
## Set the desired value for automatedModeTimeout and
## uncomment the line.

# automatedModeTimeout=

## SPECIFY ACTIVATION PROPERTIES FILE (For non-network license types only)
##
## Enter the path to an existing file that contains properties to configure
## the activation process.

activationPropertiesFile='~/activate.ini'(激活配置文件的绝对路径)

########## Begin: Options for Network License Types #########
##
## SPECIFY PATH TO LICENSE FILE (Required for network license types only)
##
## This value is required when installing either the License Manager or when
## installing as a Network End-User
## Example:
##            (Windows) licensePath=C:\TEMP\license.dat
##            (Unix) licensePath=/tmp/license.dat
## Set the desired value for licensePath and
## uncomment the line.

licensePath='~\license.lic'(license文件的绝对路径)

## CHOOSE TO INSTALL LICENSE MANAGER (For network license types only)
##
## Installs license manager files to disk.
##
## NOTE: You only need to install the license manager files
## on your license server.
##
## Set lmgrFiles value to true or false and
## uncomment the line.

# lmgrFiles=

## INSTALL LICENSE MANAGER AS A SERVICE (For network license types only)
##
## Configure the license manager as a service on Windows.
##
## NOTE: Not applicable for Unix or Mac.
##
## NOTE: The lmgr_files option (set in previous step) must also be set to true.
##
## Set lmgrService value to true or false and
## uncomment the line.

# lmgrService=

########## End: Options for Network License Types #########



################# Begin - Windows Only Options ################
##
## CHOOSE TO SET FILE ASSOCIATIONS
##
## Set to true if you want the installer to associate file types used by MathWorks
## products to this version of MATLAB, or false if you do not want the installer to
## associate MathWorks file types with this version of MATLAB.
##
## Default value is true.
##
## Set setFileAssoc value to true or false and
## uncomment the line.

# setFileAssoc=

##
## CHOOSE TO CREATE WINDOWS DESKTOP SHORTCUT
##
## Set to true if you would like the installer to create a desktop shortcut icon
## when MATLAB is installed or false if you don't want the shortcut created.
##
## Set desktopShortcut value to true or false and
## uncomment the line.

# desktopShortcut=

## CHOOSE TO ADD SHORTCUT TO WINDOWS START MENU
##
## Set to true if you would like the installer to create a Start Menu shortcut
## icon when MATLAB is installed or false if you don't want the shortcut created.
##
## Set startMenuShortcut value to true or false and
## uncomment the line.

# startMenuShortcut=

## CREATE a MATLAB Startup Accelerator task
##
## The MATLAB Startup Accelerator installer creates a
## system task to preload MATLAB into the system's cache
## for faster startup.
##
## NOTE: By default, a MATLAB Startup Accelerator task will
## automatically be created.
##
## If you want a MATLAB Startup Accelerator task to be created,
## do not edit this section.
##
## Set createAccelTask value to false if you do not want to
## create an Accelerator task and uncomment the line.

# createAccelTask=

## Enable Login Named User  licensing
##
## Set to Yes to enable use of a Login Named User license for all users of this MATLAB installation
## Users must log in to their MathWorks Account when MATLAB starts.
##
## Example: enableLNU=yes
##
## NOTE: This flag is valid in silent installations only.

# enableLNU=yes



################ End - Windows Only Options ################


## SPECIFY PRODUCTS YOU WANT TO INSTALL
##
## By default, the installer installs all the products and
## documentation for which you are licensed. Products you are not licensed for
## are not installed, even if they are listed here.
##
## Note:
## 1. To automatically install all your licensed products, do not edit
##    any lines in this section.
##
## 2. To install a specific product or a subset of products for
##    which you are licensed, uncomment the line for the product(s) you want
##    to install.

#product.5G_Toolbox
#product.Aerospace_Blockset
#product.Aerospace_Toolbox
#product.Antenna_Toolbox
#product.Audio_System_Toolbox
#product.Automated_Driving_System_Toolbox
#product.Bioinformatics_Toolbox
#product.Communications_Toolbox
#product.Computer_Vision_System_Toolbox
#product.Control_System_Toolbox
#product.Curve_Fitting_Toolbox
#product.DO_Qualification_Kit
#product.DSP_System_Toolbox
#product.Data_Acquisition_Toolbox
#product.Database_Toolbox
#product.Datafeed_Toolbox
#product.Deep_Learning_Toolbox
#product.Econometrics_Toolbox
#product.Embedded_Coder
#product.Filter_Design_HDL_Coder
#product.Financial_Instruments_Toolbox
#product.Financial_Toolbox
#product.Fixed_Point_Designer
#product.Fuzzy_Logic_Toolbox
#product.GPU_Coder
#product.Global_Optimization_Toolbox
#product.HDL_Coder
#product.HDL_Verifier
#product.IEC_Certification_Kit
#product.Image_Acquisition_Toolbox
#product.Image_Processing_Toolbox
#product.Instrument_Control_Toolbox
#product.LTE_HDL_Toolbox
#product.LTE_Toolbox
#product.MATLAB
#product.MATLAB_Coder
#product.MATLAB_Compiler
#product.MATLAB_Compiler_SDK
#product.MATLAB_Distributed_Computing_Server
#product.MATLAB_Production_Server
#product.MATLAB_Report_Generator
#product.Mapping_Toolbox
#product.Model_Predictive_Control_Toolbox
#product.Model_Based_Calibration_Toolbox
#product.OPC_Toolbox
#product.Optimization_Toolbox
#product.Parallel_Computing_Toolbox
#product.Partial_Differential_Equation_Toolbox
#product.Phased_Array_System_Toolbox
#product.Polyspace_Bug_Finder
#product.Polyspace_Code_Prover
#product.Powertrain_Blockset
#product.Predictive_Maintenance_Toolbox
#product.RF_Blockset
#product.RF_Toolbox
#product.Risk_Management_Toolbox
#product.Robotics_System_Toolbox
#product.Robust_Control_Toolbox
#product.Sensor_Fusion_and_Tracking_Toolbox
#product.Signal_Processing_Toolbox
#product.SimBiology
#product.SimEvents
#product.Simscape
#product.Simscape_Driveline
#product.Simscape_Electrical
#product.Simscape_Fluids
#product.Simscape_Multibody
#product.Simulink
#product.Simulink_3D_Animation
#product.Simulink_Check
#product.Simulink_Code_Inspector
#product.Simulink_Coder
#product.Simulink_Control_Design
#product.Simulink_Coverage
#product.Simulink_Design_Optimization
#product.Simulink_Design_Verifier
#product.Simulink_Desktop_Real_Time
#product.Simulink_PLC_Coder
#product.Simulink_Real_Time
#product.Simulink_Report_Generator
#product.Simulink_Requirements
#product.Simulink_Test
#product.Spreadsheet_Link
#product.Stateflow
#product.Statistics_and_Machine_Learning_Toolbox
#product.Symbolic_Math_Toolbox
#product.System_Identification_Toolbox
#product.Text_Analytics_Toolbox
#product.Trading_Toolbox
#product.Vehicle_Dynamics_Blockset
#product.Vehicle_Network_Toolbox
#product.Vision_HDL_Toolbox
#product.WLAN_Toolbox
#product.Wavelet_Toolbox

其中,最重要的配置为:

destinationFolder='~/matlab'(软件安装目录,注意目录和文件权限)
fileInstallationKey=09806-07443-53955-64350-21751-41297(激活码)
agreeToLicense=yes(同意安装)
mode=silent(静默安装,不弹出GUI交互界面)
activationPropertiesFile='~/activate.ini'(激活配置文件的绝对路径)
licensePath='~\license.lic'(license文件的绝对路径)
  • 再次进入解压缩后的目录,修改激活配置文件activate.ini
##################################################################
#
# Name: activate.ini
#
# Copyright 2008-2010 The MathWorks, Inc.
#
# Purpose: Activation application initialization file template. 
# Use this file to specify parameters required by the activation
# application at runtime. This file provides the activation
# application with required input without using the GUI.
#
# INSTRUCTIONS FOR RUNNING IN SILENT MODE
#
# To run the activation application in silent mode:
#
# 1. Create a copy of this template file and fill in the required 
#    information.
#
# 2. Navigate to the folder containing the activation application.
#    (Windows) $MATLABROOT\bin\$ARCH
#    (Mac/Linux) $MATLABROOT/bin
#
# 3. Launch the activation application from the command line, 
#    using the -propertiesFile option to specify the name of your 
#    activation initialization file.
#
#    (Windows) activate_matlab.exe -propertiesFile <file_name>
#    (Mac/Linux) activate_matlab.sh -propertiesFile <file_name>       
#
#  NOTE: If you want to perform silent activation automatically
#  after performing silent installation, specify the name of your
#  activation initialization file as the value of the 
#  activationPropertiesFile= option in the installer initialization 
#  file (installer_input.txt). This option causes the installer 
#  to launch the activation application in silent mode. You can
#  also specify the activation initialization file as an argument
#  when you launch the installer, using the -activationPropertiesFile 
#  option.
#
#  NOTE: When run in silent mode, the activation application does
#  not display the activation dialog boxes.
#
##################################################################
#
# SPECIFY ACTIVATION MODE
#
# Specify whether or not to run in silent mode.
#
# Valid values: true / false
#
# Default: isSilent=true.

isSilent=true(静默模式)

#
# SPECIFY ACTIVATION TYPE (Required)
# 
# Specify the type of activation you want to do.
#
# Valid values: activateDcAnon / activateOffline

activateCommand=activateOffline(离线激活)

# 
# SPECIFY LICENSE FILE LOCATION (Required if activateCommand=activateOffline)
#
# If you specified the activation type activateOffline, you
# must specify the location of the License File that you want
# to install. 
#
# Mac/Linux example:
# licenseFile=/Central/license.dat
#
# Windows example:
# licenseFile=C:\license.dat

licenseFile='~\license.lic'(license文件绝对路径)

#
# SPECIFY ACTIVATION KEY (Required if activateCommand=activateDcAnon)
#
# If you specified the activation type activateDcAnon,you must 
# specify a valid Activation Key. 
# 
# Example: activationKey=55555-55555-55555-55555 

activationKey=09806-07443-53955-64350-21751-41297(激活码)

#
# SPECIFY LICENSE FILE DESTINATION DIRECTORY (Optional)
#
# Specify the directory into which you want to install the license file.
# You must specify the full path of a directory that already exists.
# 
# NOTE: This option is only for advanced users since it could make MATLAB
# unable to start without specifying special options.
#
# Mac/Linux example:
# installLicenseFileDir=/Central/LicenseDirectory
#
# Windows examples:
# installLicenseFileDir=C:\License Directory

installLicenseFileDir='~/'(license文件绝对路径的目录)

#
# SPECIFY NAME OF INSTALLED LICENSE FILE (Optional)
#
# Specify the name of the installed License File. The file name
# must have with either .lic or .dat file extension.
# 
# Example: installLicenseFileName=license.dat

installLicenseFileName='license.lic'(license文件名称)

其中最重要的部分是:

isSilent=true(静默模式)
activateCommand=activateOffline(离线激活)
licenseFile='~\license.lic'(license文件绝对路径)
activationKey=09806-07443-53955-64350-21751-41297(激活码)
installLicenseFileDir='~/'(license文件绝对路径的目录)
installLicenseFileName='license.lic'(license文件名称)
  • 进入除了ISO解压缩或者挂载文件所在目录外任一目录内,输入安装命令
./install -inputFile ~/installer_input.txt -mode silent -fileInstallationKey 09806-07443-53955-64350-21751-41297 -agreeToLicense yes -activationPropertiesFile ~/license_standalone.lic -destinationFolder ~/matlab
  • 虽然installer_input.txt中已经有了安装配置,比如激活码和license文件路径等,但是有时安装时并没有起效,所以依然采用命令行方式配置
  • 等待安装,大概等待几分钟后,会出现寻找所有安装文件的提示,并自动在iso解压缩后的目录下进行查找,接着会开启默认安装,知道所有的组件安装完成

3.激活破解

 ./activate_matlab.sh -propertiesFile ~/activate.ini
  • 显示静默激活成功(Slient activation succeeded),完成激活
  • 继续将crack中.so文件copy到对应的文件夹中
cp -a ~/crack/R2019b/bin/glnxa64 ~/matlab/bin/

4.启动配置

  • 安装完成后,在/bin目录下输入matlab,即可打开matlab软件(静默方式)
  • 为了添加该用户在任意目录下都能打开,添加相关配置
打开~/.bashrc,在后面添加以下两行
export MATLAB_HOME=/home/maizhenzu/matlab
export PATH=${MATLAB_HOME}/bin:$PATH
保存并关闭后,在bash中输入以下命令
source ~/.bashrc
  • 进而可以在任意本地目录中,输入matlab打开matlab程序

5.注意事项

  • 安装时,可以对整个iso解压缩后的文件,使用chmod -R 777赋予可执行文件的属性
posted @ 2020-06-29 18:46  scbox  阅读(3388)  评论(0编辑  收藏  举报