且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

删除所有已安装的 OpenCV 库

更新时间:2023-12-02 19:54:34

默认情况下,当从源代码构建 OpenCV 时,它会将其输出放在 /usr/local/lib/usr/local/bin.虽然,从您的错误消息来看,它看起来像是将库放在 /usr/lib 中,将二进制文件放在 /usr/bin 中,因此您也可以在那里检查.

By default, when building OpenCV from source, it will place it's output in /usr/local/lib and /usr/local/bin. Although, judging from your error messages, it looks like it placed the libraries in /usr/lib and the binaries in /usr/bin, so you might also check in there.

您也可以使用 Linux find 命令.因此,要查找所有 OpenCV 库,您可以执行以下操作(这可能需要一段时间):

You can also use the Linux find command. So, to find all OpenCV libraries you can do the following (this might take a while):

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

上面的命令将查找名称中包含 opencv 的任何文件,并提示您将其删除.一如既往,手动删除东西时要小心!

The above command will find any file containing opencv in the name, and will prompt you to remove it. As always, be careful when deleting things manually!

另一种选择可能是再次手动编译 OpenCV(完全,就像您之前所做的那样),make install 以创建安装清单,以及然后尝试 make uninstall 看看它是否会自行清理.

Another option might be to manually compile OpenCV again (exactly as you did before), make install to create the install manifest, and then try make uninstall to see if it will clean up itself.

希望有帮助!:)