简介
近期更新,卸载的opencv版本为3.4.10,非无脑复制粘贴帖
,方法未失效
。
注意我这个方法是卸载采用官网下载tar包,然后一步步编译的安装的这样的方式安装的opencv
1.查看opencv版本
pkg-config --modversion opencv
output
3.4.10
2.卸载
找到当初安装opencv建立的build目录,进入目录执行卸载操作
cd cd /home/cheng/somelib/opencv-3.4.10/build/
sudo make uninstall
cd ..
rm -rf build
3.删除相关项
rm -rf /usr/local/include/opencv2
rm -rf /usr/local/include/opencv
rm -rf /usr/include/opencv
rm -rf /usr/include/opencv2
rm -rf /usr/local/share/opencv
rm -rf /usr/local/share/OpenCV
rm -rf /usr/share/opencv
rm -rf /usr/share/OpenCV
rm -rf /usr/local/bin/opencv*
rm -rf /usr/local/lib/libopencv*
可能有的没有,没有就不用删了,嫌麻烦直接执行下面的指令,我用了也没啥问题
$ cd /usr
$ find . -name "*opencv*" | xargs sudo rm -rf
4.查看删除情况
再次执行
pkg-config --modversion opencv
输出,可以看到删没了
Package opencv was not found in the pkg-config search path.
Perhaps you should add the directory containing `opencv.pc'
to the PKG_CONFIG_PATH environment variable
No package 'opencv' found
大功告成。