opencv2.4.9卸载安装

时间:2022-06-08 13:15:47

1. 查看安装的opencv版本。

查看opencv安装的版本,发现安装版本为2.4.8.

pkg-config --modversion opencv

2. 用下面方式卸载opencv2.4.8,

 sudo apt-get autoremove libopencv-dev

3.安装opencv2.4.,9

采用下载源代码的方式,下载2.4.9 ,保存并解压到  /home/Downloads。此源代码不要删除,由于下次卸载时需要从该目录运行代码。

/home/louis/Downloads/opencv-2.4.\
mkdir build
cd build
cmake /home/louis/Downloads/opencv-2.4.\
make //无尽的等待
sudo make install

sudo make install安装完成后,显示

Set runtime path of "/usr/local/bin/opencv_haartraining" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_createsamples
-- Set runtime path of "/usr/local/bin/opencv_createsamples" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_performance
-- Set runtime path of "/usr/local/bin/opencv_performance" to "/usr/local/lib"
-- Installing: /usr/local/bin/opencv_traincascade
-- Set runtime path of "/usr/local/bin/opencv_traincascade" to "/usr/local/lib"

小萝卜:装完之后OpenCV在哪里呢?
师兄:头文件在/usr/local/include/,里面有opencv和opencv2的头文件。我们基本只用opencv2啦。
师兄:库文件就在/usr/local/lib/下面,当然这些在install的时候都是可以改动的,我列的是默认位置。

4.卸载opencv2.4.9

首先要找到当初安装opencv sourcecode的build目录,进入该build目录执行如下操作:

sudo make uninstall
cd ..
sudo rm -r build
rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*

首先要找到当初安装opencv sourcecode的build目录(如果不明白什么是build目录可以先跳过这一步,看第3步.),进入该build目录执行如下操作:

sudo make uninstall
cd ..
sudo rm -r build
rm -r /usr/local/include/opencv2 /usr/local/include/opencv /usr/include/opencv /usr/include/opencv2 /usr/local/share/opencv /usr/local/share/OpenCV /usr/share/opencv /usr/share/OpenCV /usr/local/bin/opencv* /usr/local/lib/libopencv*