ubuntu 11.10上的opencv安装

时间:2012-03-07 09:03:01

标签: ubuntu opencv installation

我正在尝试使用终端在Ubuntu11.10上安装OpenCV。但它给了我以下错误。我无法解决它。注意最后四行。

$sudo apt-get install opencv  
Reading package lists... Done  
Building dependency tree         
Reading state information... Done  
The following extra packages will be installed:  
 libopencv2.3  
The following NEW packages will be installed:  
 libopencv2.3 opencv  
0 upgraded, 2 newly installed, 0 to remove and 2 not upgraded.  
Need to get 11.8 MB of archives.  
After this operation, 88.7 MB of additional disk space will be used.  
Do you want to continue [Y/n]? Y  
 Get:1 http://ppa.launchpad.net/gijzelaar/opencv2.3/ubuntu/ oneiric/main libopencv2.3 i386    2.3.1-3 [11.5 MB]  
Get:2 http://ppa.launchpad.net/gijzelaar/opencv2.3/ubuntu/ oneiric/main opencv i386 2.3.1-3 [264 kB]  
Fetched 11.8 MB in 22s (528 kB/s)                                                          
(Reading database ... 240623 files and directories currently installed.)  
Unpacking libopencv2.3 (from .../libopencv2.3_2.3.1-3_i386.deb) ...    
dpkg: error processing /var/cache/apt/archives/libopencv2.3_2.3.1-3_i386.deb (--unpack):
trying to overwrite '/usr/lib/libopencv_highgui.so.2.3.1', which is also in package libopencv-highgui2.3 2.3.1-4ppa1    
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)  
Unpacking opencv (from .../opencv_2.3.1-3_i386.deb) ...  
dpkg: error processing /var/cache/apt/archives/opencv_2.3.1-3_i386.deb (--unpack):
trying to overwrite '/usr/bin/opencv_createsamples', 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_i386.deb  
 /var/cache/apt/archives/opencv_2.3.1-3_i386.deb  
E: Sub-process /usr/bin/dpkg returned an error code (1)  
$ 

1 个答案:

答案 0 :(得分:2)

对于这样的错误:

dpkg: error processing /var/cache/apt/archives/AAA (--unpack):
trying to overwrite `/usr/lib/BBB', which is also in package CCC
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Errors were encountered while processing:
AAA
E: Sub-process /usr/bin/dpkg returned an error code (1)

(其中AAA,BBB,CCC是占位符名称,如果不清楚的话)

DO

sudo dpkg -i --force-overwrite AAA

(给出AAA的完整路径),然后运行

sudo apt-get -f install

试。

此外,在发布问题之前尝试谷歌搜索,因为有大量链接解释如何解决此错误!