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賦予可執行文件的屬性


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM