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

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

问题描述

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

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

在阅读所有这些内容之前:

Before you read all this :

我只想从系统中删除所有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 查找命令.因此,要查找所有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天全站免登陆