一、安装sudo

sudo: command not found 的解决方法

apt-get install sudo
apt-get update

二、安装JAVA JDK8

Ubuntu 16.04安装Java JDK8

手动下载压缩包安装oracle Java JDK

1、前往oracle Java官网下载JDK(http://www.oracle.com/technetwork/java/javase/downloads/index.html)

2、解压缩到指定目录(以jdk-8u144-linux-x64.tar.gz为例)
创建目录:

sudo mkdir /usr/lib/jvm

解压缩到该目录

sudo tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm

3.修改环境变量:

sudo vi ~/.bashrc

在文件末尾追加下面内容:

#set oracle jdk environment
export JAVA_HOME=/usr/lib/jvm  
export JRE_HOME=${JAVA_HOME}/jre  
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  
export PATH=${JAVA_HOME}/bin:$PATH  

使环境变量马上生效:

source ~/.bashrc

4、系统注册此jdk

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0_60/bin/java 300

5、查看java版本,看看是否安装成功:

java -version

三、安装MATLAB

创建docker的时候加上命令–privileged=True就OK

现在才说,是不是有点坑。。。
再重新来一遍吧QAQ。。。
docker安装matlab mount failed: Operation not permitted.

matlab2017b镜像挂载

sudo mkdir /media/matlab        
sudo mount -o loop matlab-r2017b-linux_iso /media/matlab/

可能存在的问题:mount: /media/matlib: WARNING: device write-protected, mounted read-only
不用管这个问题!

matlab的安装及pj

sudo mkdir /usr/local/MATLAB    # 构建安装路径
sudo /media/matlab/install -mode silent -fileInstallationKey 09806-07443-53955-64350-21751-41297 -agreeToLicense yes -activationPropertiesFilehome /path-to-Linux/R2017b/license_standalone.lic -destinationFolderhome /usr/local/MATLAB
sudo cp /path-to-Linux/MATLABR2017b_Linux_Crack/license_standalone.lic /usr/local/MATLAB/R2017b/licenses
sudo cp /path-to-Linux/MATLABR2017b_Linux_Crack/libmwservices /usr/local/MATLAB/R2017b/bin/glnxa64

安装依赖

sudo apt-get install libxmu6

设置环境变量

打开配置文件

sudo vim ~/.bashrc

添加以下内容

export PATH=/usr/local/MATLAB/R2017b/bin:$PATH

使修改的配置文件生效

source ~/.bashrc

取消挂载

sudo umount /media/matlab 

安装matlab工具箱

可以选择自己需要的工具复制上去即可。

cmake安装

ubuntu16.04安装opencv3.4.1教程

可能会遇见下面的错误,直接复制cmake文件即可!
-bash: /usr/bin/cmake: No such file or directory错误

安装opencv

安装依赖的时候又安装了aptitude

结果需要卸载aptitude 重新安装apt

安装aptitude后apt不能使用,aptitude换回apt,apt:找不到命令
三个安装包等我上传百度网盘后,给大家共享。

opencv3.4确实是比opencv3.2好安装

Ubuntu18安装opencv3.4

开始运行程序了

报错了!
时间紧,暂且放在这里,等我回来更新。


------------------------------------------------------------------------
       Segmentation violation detected at Tue Feb 22 04:48:56 2022
------------------------------------------------------------------------

Configuration:
  Crash Decoding      : Disabled - No sandbox or build area path
  Crash Mode          : continue (default)
  Current Graphics Driver: Unknown software 
  Current Visual      : None
  Default Encoding    : US-ASCII
  Deployed            : false
  GNU C Library       : 2.27 stable
  Host Name           : 15c385675a28
  MATLAB Architecture : glnxa64
  MATLAB Entitlement ID: 6257193
  MATLAB Root         : /usr/local/MATLAB/R2017b
  MATLAB Version      : 9.3.0.713579 (R2017b)
  OpenGL              : software
  Operating System    : Linux 4.15.0-142-generic #146~16.04.1-Ubuntu SMP Tue Apr 13 09:27:15 UTC 2021 x86_64
  Processor ID        : x86 Family 6 Model 94 Stepping 3, GenuineIntel
  Virtual Machine     : Java 1.8.0_121-b13 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
  Window System       : No active display

Fault Count: 1


Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 0000000000000000  RBX = 00007f711558d640
  RCX = 00007f7115884bb8  RDX = 0000000000000009
  RSP = 00007f71fbdf10e0  RBP = 00007f71fbdf11f0
  RSI = 0000000000000000  RDI = 00007f7115578310

   R8 = 0000000000000048   R9 = 0000000000000004
  R10 = 00007f717b430c40  R11 = 0000000000000033
  R12 = 0000000000000006  R13 = 00007f71155784c0
  R14 = 00007f717b430c40  R15 = 0000001200000006

  RIP = 00007f721edb6c78  EFL = 0000000000010206

   CS = 0033   FS = 0000   GS = 0000

Stack Trace (from fault):
[  0] 0x00007f721edb6c78                        /lib64/ld-linux-x86-64.so.2+00052344
[  1] 0x00007f721edbf25d                        /lib64/ld-linux-x86-64.so.2+00086621
[  2] 0x00007f721cb001ef                    /lib/x86_64-linux-gnu/libc.so.6+01470959 _dl_catch_exception+00000111
[  3] 0x00007f721edbe96a                        /lib64/ld-linux-x86-64.so.2+00084330
[  4] 0x00007f721c593f96                   /lib/x86_64-linux-gnu/libdl.so.2+00003990
[  5] 0x00007f721cb001ef                    /lib/x86_64-linux-gnu/libc.so.6+01470959 _dl_catch_exception+00000111
[  6] 0x00007f721cb0027f                    /lib/x86_64-linux-gnu/libc.so.6+01471103 _dl_catch_error+00000047
[  7] 0x00007f721c594745                   /lib/x86_64-linux-gnu/libdl.so.2+00005957
[  8] 0x00007f721c594051                   /lib/x86_64-linux-gnu/libdl.so.2+00004177 dlopen+00000113
[  9] 0x00007f721a8a33f6                               bin/glnxa64/libut.so+00365558
[ 10] 0x00007f721a8a6565                               bin/glnxa64/libut.so+00378213 _Z11utGetModuleRKSbIDsSt11char_traitsIDsESaIDsEEPi+00000229
[ 11] 0x00007f720f453afe                   bin/glnxa64/libmwm_dispatcher.so+00482046
[ 12] 0x00007f720f443ab2                   bin/glnxa64/libmwm_dispatcher.so+00416434 _ZN13Mlm_MATLAB_fn8try_loadEv+00000066
[ 13] 0x00007f720f43a7fa                   bin/glnxa64/libmwm_dispatcher.so+00378874 _ZN13Mlm_MATLAB_fn4loadEv+00000042
[ 14] 0x00007f720f437c4c                   bin/glnxa64/libmwm_dispatcher.so+00367692 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000060
[ 15] 0x00007f71c8a149ef                   bin/glnxa64/libmwmlintrospect.so+00113135
[ 16] 0x00007f720f4525ce                   bin/glnxa64/libmwm_dispatcher.so+00476622
[ 17] 0x00007f720f437e78                   bin/glnxa64/libmwm_dispatcher.so+00368248 _ZN13Mfh_MATLAB_fn11dispatch_fhEiPP11mxArray_tagiS2_+00000616
[ 18] 0x00007f720bb1490a                          bin/glnxa64/libmwm_lxe.so+12519690
[ 19] 0x00007f720bb15d9e                          bin/glnxa64/libmwm_lxe.so+12524958
[ 20] 0x00007f720bbd6779                          bin/glnxa64/libmwm_lxe.so+13313913
[ 21] 0x00007f720bb7beb1                          bin/glnxa64/libmwm_lxe.so+12943025
[ 22] 0x00007f720b463e50                          bin/glnxa64/libmwm_lxe.so+05504592
[ 23] 0x00007f720b4660e4                          bin/glnxa64/libmwm_lxe.so+05513444
[ 24] 0x00007f720b4628d1                          bin/glnxa64/libmwm_lxe.so+05499089
[ 25] 0x00007f720b45e861                          bin/glnxa64/libmwm_lxe.so+05482593
[ 26] 0x00007f720b45ec89                          bin/glnxa64/libmwm_lxe.so+05483657
[ 27] 0x00007f720b462100                          bin/glnxa64/libmwm_lxe.so+05497088
[ 28] 0x00007f720b4621cf                          bin/glnxa64/libmwm_lxe.so+05497295
[ 29] 0x00007f720b5621d1                          bin/glnxa64/libmwm_lxe.so+06545873
[ 30] 0x00007f720b564f53                          bin/glnxa64/libmwm_lxe.so+06557523
[ 31] 0x00007f720ba144ce                          bin/glnxa64/libmwm_lxe.so+11470030
[ 32] 0x00007f720bb05f1e                          bin/glnxa64/libmwm_lxe.so+12459806
[ 33] 0x00007f720f4a8c83                   bin/glnxa64/libmwm_dispatcher.so+00830595 _ZN8Mfh_file16dispatch_fh_implEMS_FviPP11mxArray_tagiS2_EiS2_iS2_+00000947
[ 34] 0x00007f720f4a954e                   bin/glnxa64/libmwm_dispatcher.so+00832846 _ZN8Mfh_file11dispatch_fhEiPP11mxArray_tagiS2_+00000030
[ 35] 0x00007f720bb1490a                          bin/glnxa64/libmwm_lxe.so+12519690
[ 36] 0x00007f720bb15d9e                          bin/glnxa64/libmwm_lxe.so+12524958
[ 37] 0x00007f720bbd68c9                          bin/glnxa64/libmwm_lxe.so+13314249
[ 38] 0x00007f720bb7bf01                          bin/glnxa64/libmwm_lxe.so+12943105
[ 39] 0x00007f720b463e50                          bin/glnxa64/libmwm_lxe.so+05504592
[ 40] 0x00007f720b4660e4                          bin/glnxa64/libmwm_lxe.so+05513444
[ 41] 0x00007f720b4628d1                          bin/glnxa64/libmwm_lxe.so+05499089
[ 42] 0x00007f720b45e861                          bin/glnxa64/libmwm_lxe.so+05482593
[ 43] 0x00007f720b45ec89                          bin/glnxa64/libmwm_lxe.so+05483657
[ 44] 0x00007f720b462100                          bin/glnxa64/libmwm_lxe.so+05497088
[ 45] 0x00007f720b4621cf                          bin/glnxa64/libmwm_lxe.so+05497295
[ 46] 0x00007f720b5621d1                          bin/glnxa64/libmwm_lxe.so+06545873
[ 47] 0x00007f720b564f53                          bin/glnxa64/libmwm_lxe.so+06557523
[ 48] 0x00007f720ba144ce                          bin/glnxa64/libmwm_lxe.so+11470030
[ 49] 0x00007f720b9d98fa                          bin/glnxa64/libmwm_lxe.so+11229434
[ 50] 0x00007f720b9d9e78                          bin/glnxa64/libmwm_lxe.so+11230840
[ 51] 0x00007f720b9db6e2                          bin/glnxa64/libmwm_lxe.so+11237090
[ 52] 0x00007f720ba5124e                          bin/glnxa64/libmwm_lxe.so+11719246
[ 53] 0x00007f720ba51702                          bin/glnxa64/libmwm_lxe.so+11720450
[ 54] 0x00007f720ed9f9a1                  bin/glnxa64/libmwm_interpreter.so+02431393 _Z51inEvalCmdWithLocalReturnInDesiredWSAndPublishEventsRKSbIDsSt11char_traitsIDsESaIDsEEPibbP15inWorkSpace_tag+00000065
[ 55] 0x00007f7210333823                            bin/glnxa64/libmwiqm.so+00694307 _ZNK3iqm18InternalEvalPlugin24inEvalCmdWithLocalReturnERKSbIDsSt11char_traitsIDsESaIDsEEP15inWorkSpace_tag+00000083
[ 56] 0x00007f721033517b                            bin/glnxa64/libmwiqm.so+00700795 _ZN3iqm18InternalEvalPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000123
[ 57] 0x00007f720f98f40d                            bin/glnxa64/libmwmcr.so+00656397
[ 58] 0x00007f72103268b8                            bin/glnxa64/libmwiqm.so+00641208
[ 59] 0x00007f7210314db2                            bin/glnxa64/libmwiqm.so+00568754
[ 60] 0x00007f720d97277a                         bin/glnxa64/libmwbridge.so+00165754
[ 61] 0x00007f720d97a1c3                         bin/glnxa64/libmwbridge.so+00197059
[ 62] 0x00007f720d97a2db                         bin/glnxa64/libmwbridge.so+00197339
[ 63] 0x00007f720d97a9b7                         bin/glnxa64/libmwbridge.so+00199095 _Z8mnParserv+00000647
[ 64] 0x00007f720f977793                            bin/glnxa64/libmwmcr.so+00558995
[ 65] 0x00007f720f97992e                            bin/glnxa64/libmwmcr.so+00567598
[ 66] 0x00007f720f97a099                            bin/glnxa64/libmwmcr.so+00569497 _ZN5boost6detail17task_shared_stateINS_3_bi6bind_tIvPFvRKNS_8functionIFvvEEEENS2_5list1INS2_5valueIS6_EEEEEEvE6do_runEv+00000025
[ 67] 0x00007f720f9788b6                            bin/glnxa64/libmwmcr.so+00563382
[ 68] 0x00007f721035c259                            bin/glnxa64/libmwiqm.so+00860761
[ 69] 0x00007f7210348b6c                            bin/glnxa64/libmwiqm.so+00781164 _ZN5boost6detail8function21function_obj_invoker0ISt8functionIFNS_3anyEvEES4_E6invokeERNS1_15function_bufferE+00000028
[ 70] 0x00007f721034884c                            bin/glnxa64/libmwiqm.so+00780364 _ZN3iqm18PackagedTaskPlugin7executeEP15inWorkSpace_tagRN5boost10shared_ptrIN14cmddistributor17IIPCompletedEventEEE+00000428
[ 71] 0x00007f72103268b8                            bin/glnxa64/libmwiqm.so+00641208
[ 72] 0x00007f721031453f                            bin/glnxa64/libmwiqm.so+00566591
[ 73] 0x00007f7210316759                            bin/glnxa64/libmwiqm.so+00575321
[ 74] 0x00007f721e193aba                       bin/glnxa64/libmwservices.so+02702010
[ 75] 0x00007f721e19506f                       bin/glnxa64/libmwservices.so+02707567
[ 76] 0x00007f721e19581a                       bin/glnxa64/libmwservices.so+02709530 _Z25svWS_ProcessPendingEventsiib+00000186
[ 77] 0x00007f720f977f0e                            bin/glnxa64/libmwmcr.so+00560910
[ 78] 0x00007f720f9782b4                            bin/glnxa64/libmwmcr.so+00561844
[ 79] 0x00007f720f965c06                            bin/glnxa64/libmwmcr.so+00486406
[ 80] 0x00007f721cd916db              /lib/x86_64-linux-gnu/libpthread.so.0+00030427
[ 81] 0x00007f721caba71f                    /lib/x86_64-linux-gnu/libc.so.6+01185567 clone+00000063
[ 82] 0x0000000000000000                                   <unknown-module>+00000000


If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/

A technical support engineer might contact you with further information.

Thank you for your help.
Logo

权威|前沿|技术|干货|国内首个API全生命周期开发者社区

更多推荐