LINUX无root权限安装MATLAB
1.安装XORRISO
无root权限使用mount命令提取iso文件,使用xorriso。
下载xorriso: https://www.gnu.org/software/xorriso/
安装命令:
tar -zxvf xorriso-1.4.6.tar.gz cd xorriso-1.4.6 ./configure make cd xorriso pwd
将显示的路径加入到PATH环境变量中。
export XORRISO=$APP/xorriso-1.5.0/xorriso
export PATH=$XORRISO:$PATH
提出ISO文件:
xorriso -osirrox on -indev image.iso -extract / MATLAB_SRC
参考:https://superuser.com/questions/180744/how-do-i-extract-an-iso-on-linux-without-root-access
2.安装matlab
cd MATLAB_SRC
修改activate.ini
上图来源:https://blog.csdn.net/Xiao_Song_PKU/article/details/82700228
./install -mode silent -fileInstallationKey 09806-07443-53955-64350-21751-41297 -agreeToLicense yes -activationPropertiesFile /Data/wind/person/gaoyy/MATLAB_SRC/activate.ini -destinationFolder /Data/wind/person/gaoyy/MATLAB
注释:
-mode silent 是无交互界面静默安装
-agreeToLicense yes ?
-fileInstallationKey 激活码
-activationPropertiesFile 激活文件activate.ini
-destinationFolder 安装路径(必须是绝对路径)
3.激活和破解
激活
(可能是为了防止第一次启动需要激活吧,原因不清楚,保险起见再使用activate_matlab.sh激活一次)
进入目录:/Data/wind/person/gaoyy/MATLAB/bin
./activate_matlab.sh -propertiesFile /Data/wind/person/gaoyy/MATLAB_SRC/activate.ini
显示静默激活成功(Slient activation succeeded),完成激活
破解
cd /Data/wind/person/gaoyy/MATLAB/bin/glnxa64
rm -rf libcufft.so.7.0.28 libinstutil.so libmwservices.so
得先强制删除上述文件
再把安装包中crack中相应目录的 libcufft.so.7.0.28 libinstutil.so libmwservices.so复制到/Data/wind/person/gaoyy/MATLAB/bin/glnxa64目录中
激活和破解两段参考:https://blog.csdn.net/Xiao_Song_PKU/article/details/82700228
证书
在安装的顶层目录/Data/wind/person/gaoyy/MATLAB建立licenses文件夹,再将crack中的license_server.lic和license_standalone.lic复制到licenses中。
不进行此步骤会出现如下错误:
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
此段参考:http://blog.sina.com.cn/s/blog_6f8171770102x2hx.html
4.验证
在bin目录下
./matlab
5.添加环境变量
export MATLAB=/Data/wind/person/gaoyy/MATLAB
export PATH=$MATLAB/bin:$PATH
最后source一下
添加环境变量以后,可在任意窗口输入matlab开启
错误
MATLAB is selecting SOFTWARE OPENGL rendering.
Fatal Error on startup: Cannot locate or initialize class com/mathworks/jmi/OpaqueJavaInterface.
java.lang.NoClassDefFoundError: com/mathworks/jmi/OpaqueJavaInterface
Caused by: java.lang.ClassNotFoundException: com.mathworks.jmi.OpaqueJavaInterface
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
docker.io : Depends: containerd (>= 0.2.5~)
Depends: runc (>= 1.0.0~rc2-0ubuntu1~)
Recommends: apparmor but it is not going to be installed
:
:
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
安装OPENGL:https://www.linuxidc.com/Linux/2017-03/141555.htm
4、sudo apt-get install matlab-support
配置环境、连启动器都配好了。
matlab -nodesktop -nosplash -nojvm -r 'meshdemo(5);quit;'