在ubuntu下删除opencv需要以下步骤:
1.进入opencv的源代码文件夹下的release(这是你在安装opencv时候自己命名的,cmake时候所在的目录)
2.执行以下命令
sudo make uninstall cd .. sudo rm -r build 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*
删除/usr中所有opencv相关项
cd /usr/ find . -name "*opencv*" | xargs sudo rm -rf
移除Python相关
apt-get remove opencv-doc opencv-data python-opencv
******如果找不到当初安装的目录,执行1,执行3,再执行2。******因为机器共享给小伙伴一起用的,我就没找到2.4.9的安装目录,估计当时被删了,所以我先下了一个249,build一遍后才uninstall的。