ubuntu卸载opencv
转自:https://blog.csdn.net/m0_37605642/article/details/120111105
1、自动卸载
# 如果删掉了build,再安装上面编译生成一个 cd /opt/opencv-3.4.10/build sudo make uninstall cd .. sudo rm -r build
2、手动删除相关文件
具体根据自己的文件路径修改
sudo rm -r \ /usr/include/opencv4 \ /usr/lib/cmake/opencv4 \ /usr/lib/python3.9/site-packages/cv2 \ /usr/share/licenses/opencv4 \ /usr/share/opencv4 \ /usr/share/java/opencv4 \ /usr/local/include/opencv4 \ /usr/local/share/opencv4 \ /usr/local/bin/opencv* \ /usr/local/lib/libopencv* \ /usr/local/lib/pkgconfig/opencv4.pc \ /usr/local/lib/cmake/opencv4
3、卸载并清理
# 会删除python的opencv环境 sudo apt \ 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
4、检查是否卸载完成
pkg-config opencv --libs pkg-config opencv --modversion pkg-config --cflags --libs opencv sudo find / -iname "*opencv*"