ubuntu下彻底卸载opencv的方法

之前通过 apt-get 的方法安装过opencv,然后又通过编译安装的方法安装了opencv2.4.9

使用了文章ubuntu卸载opencv并重装opencv3.0.0中的方法,分别

1. $ sudo make uninstall
2. $ cd ..
3. $ sudo rm -r build
4. $ sudo 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*

以及

5. sudo apt-get –purge remove opencv-doc opencv-data python-opencv

但是并没有卸载干净,通过命令

pkg-config opencv --libs
pkg-config opencv --modversion

还是可以显示出opencv的相关信息。

然后开始寻找其他方法,通过这条命令

sudo apt-get autoremove opencv-doc opencv-data libopencv-dev libopencv2.4-java libopencv2.4-jni python-opencv libopencv-core2.4 libopencv-gpu2.4 libopencv-ts2.4 libopencv-photo2.4 libopencv-contrib2.4 libopencv-imgproc2.4 libopencv-superres2.4 libopencv-stitching2.4 libopencv-ocl2.4 libopencv-legacy2.4 libopencv-ml2.4 libopencv-video2.4 libopencv-videostab2.4 libopencv-objdetect2.4 libopencv-calib3d2.4

基本可以把opencv相关库卸载干净。

还有一条最狠的是

$> sudo find / -name "*opencv*" -exec rm -i {} \;

这条运行时需要手动确认查找到的每条结果是否进行删除,请千万看清楚再删。

你可能感兴趣的:(ubuntu下彻底卸载opencv的方法)