删除所有已安装的 OpenCV 库 [英] Removing all installed OpenCV libs

查看:30
本文介绍了删除所有已安装的 OpenCV 库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行 Kubuntu 11.10(带 KDE 4.8)

I'm running Kubuntu 11.10 (w/ KDE 4.8)

在你阅读这一切之前:

我只想从我的系统中删除所有 OpenCV 的痕迹,这样我就可以重新开始..

I just want to remove all traces of OpenCV from my system, so I can start afresh..

整个故事

我首先从 https://launchpad.net/~gijzelaar/安装了 python-opencv 和 libopencv(我认为是 2.1)+archive/opencv2 很久以前.我当时只试过python-opencv,效果很好(我没有尝试使用OpenCV使用C++代码)

I first installed python-opencv and libopencv (2.1 I think) from https://launchpad.net/~gijzelaar/+archive/opencv2 a long time ago. I only tried python-opencv at that time, which worked perfectly (I didn't attempt using C++ code using OpenCV)

然后我最近尝试从源代码安装 OpenCV 2.3.1,它已经安装,但是在编译我自己的 C++ 代码(使用 OpenCV)时,它给了我关于未安装 libgtk 的错误,并且还破坏了我运行良好的 python opencv 代码早些

Then I recently tried to install OpenCV 2.3.1 from source, which got installed but while compiling my own C++ code (using OpenCV), it gave me errors about libgtk not installed and also broke my python opencv code which was running fine earlier

所以我安装了 libgtk2-dev 库并再次编译并安装了 OpenCV 2.3.1..

So I installed the libgtk2-dev libraries and compiled and installed OpenCV 2.3.1 again..

错误仍然发生,所以我删除了运行 cmake、make 等的未压缩的 OpenCV 目录.我没有卸载(我现在意识到这是我的错误)

The error still occured, so I deleted the untarred OpenCV directory from which I was running cmake, make ,etc. I did NOT make uninstall (which I now realize was my mistake)

而是从这里安装了 ubuntu opencv 2.3 包(包含所有依赖项):https://launchpad.net/~gijzelaar/+archive/opencv2.3

and instead installed the ubuntu opencv 2.3 package (with all dependencies) from here : https://launchpad.net/~gijzelaar/+archive/opencv2.3

现在的问题是,当我编译包含 OpenCV 的 C++ 代码时,我仍然遇到同样的错误,并且该错误仍然指向我的(已删除的)OpenCV 源文件夹:

Now the problem is I still get the same error when I compile my C++ code which includes OpenCV , and the error still points to my (deleted) OpenCV source folder :

OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvNamedWindow, file /home/anant/opencv/OpenCV-2.3.1/modules/highgui/src/window.cpp, line 275
terminate called after throwing an instance of 'cv::Exception'
  what():  /home/anant/opencv/OpenCV-2.3.1/modules/highgui/src/window.cpp:275: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvNamedWindow

如您所见,错误仍然指向我编译和安装 OpenCV 的目录

As you can see the error still points to the directory from where I had compiled and installed OpenCV

有没有办法完全删除我编译的 OpenCV 版本的所有痕迹,而只保留 ubuntu 包中的文件?正如我之前提到的,我没有卸载"并且还(愚蠢地)删除了安装清单

Is there a way to completely remove all traces of my compiled version of OpenCV and just keep the files from the ubuntu package? As I mentioned earlier I did not 'make uninstall' and have also (foolishly) deleted the install-manifest

我再次运行包管理器,发现并非所有来自 ppa 的 opencv 包都已正确安装.所以我又做了一个 sudo apt-get install opencv,现在我得到这个错误:

I ran the package manager again,and found that not all opencv packages from the ppa had gotten installed properly. So I did a sudo apt-get install opencv again, and now I get this error:

Unpacking libopencv2.3 (from .../libopencv2.3_2.3.1-3_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/libopencv2.3_2.3.1-3_amd64.deb (--unpack):
 trying to overwrite '/usr/lib/libopencv_video.so.2.3.1', which is also in package libopencv-video2.3 2.3.1-4ppa1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Unpacking opencv (from .../opencv_2.3.1-3_amd64.deb) ...
dpkg: error processing /var/cache/apt/archives/opencv_2.3.1-3_amd64.deb (--unpack):
 trying to overwrite '/usr/bin/opencv_haartraining', which is also in package libopencv-core-dev 2.3.1-4ppa1
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
 /var/cache/apt/archives/libopencv2.3_2.3.1-3_amd64.deb
 /var/cache/apt/archives/opencv_2.3.1-3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我只想从我的系统中删除所有 OpenCV 的痕迹,这样我就可以重新开始

I just want to remove all traces of OpenCV from my system, so I can start afresh

推荐答案

默认情况下,当从源代码构建 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.

希望有帮助!:)

这篇关于删除所有已安装的 OpenCV 库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆