1.查看已安装的opencv版本
pkg-config --modversion opencv
2.卸载(找到当初安装opencv的build目录)
sudo make uninstall
cd ..
sudo rm -r build
3.删除其余的
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