ubuntu重装系统记录

2021/12/8 7:20:04

本文主要是介绍ubuntu重装系统记录,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

文章目录

  • 重装系统
    • 运行raft的时候报错
    • 安装ros的时候失败了
      • 解决办法
    • Ubuntu18.04下安装OpenCv依赖包libjasper-dev无法安装的问题
      • 解决办法
    • 使用sudo ldconfig
      • 解决办法
    • orbslam2报错
      • 解决办法
  • ubuntu18.04安装opencv

重装系统

运行raft的时候报错

cv2.error: OpenCV(3.4.2) /tmp/build/80754af9/opencv-suite_1535558553474/work/modules/highgui/src/window.cpp:632: error: (-2:Unspecified error) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubu

解决办法

# pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ opencv-contrib-python

安装ros的时候失败了

sudo ros-dep init 出错

解决办法

# sudo apt-get install python3-pip 

# sudo pip install rosdepc

Ubuntu18.04下安装OpenCv依赖包libjasper-dev无法安装的问题

解决办法

sudo add-apt-repository "deb http://security.ubuntu.com/ubuntu xenial-security main"
sudo apt update
sudo apt install libjasper1 libjasper-dev

使用sudo ldconfig

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8 不是符号链接

/sbin/ldconfig.real: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8 不是符号链接

解决办法

进入到/usr/local/cuda-10.1/targets/x86_64-linux/lib目录查看后缀版本号

$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_train.so.8.0.5 /usr/local/cuda-10.1/targ^Cs/x86_64-linux/lib/libcudnn_adv_train.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_infer.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_train.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_adv_infer.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_ops_train.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn_cnn_infer.so.8
$ sudo ln -sf /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.8.0.5 /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.8
$ sudo ldconfig

orbslam2报错

error: ‘usleep’ was not declared in this scope
usleep(3000);

解决办法

在相应文件中添加

#include <unistd.h>

ubuntu18.04安装opencv

首先安传依赖项

$ sudo apt-get install build-essential cmake git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev
$ sudo apt-get install checkinstall yasm libtiff5-dev libjpeg-dev libjasper-dev libdc1394-22-dev libxine2-dev libgstreamer0.10-dev libgstreamer-plugins-base0.10-dev libv4l-dev python-dev python-numpy libtbb-dev libqt4-dev libgtk2.0-dev libfaac-dev libmp3lame-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev x264 v4l-utils libeigen3-dev
$ cd opencv-3.4.0
$ mkdir build && cd build
$ cmake -D CMAKE_BUILD_TYPE=Release -D CMAKE_INSTALL_PREFIX=/usr/local .. 
$ make -j8
$ sudo make install 	

然后配置环境

$ sudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf'
$ sudo ldconfig
$ sudo vim /etc/profile
//添加如下这一行
export  PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig 

然后查看opencv版本

$ pkg-config --modversion opencv


这篇关于ubuntu重装系统记录的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程