如果我嘗試運行,sudo apt-get install python-box2d
我會收到以下無意義的錯誤訊息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
libcv-dev : Depends: libopencv-core-dev but it is not going to be installed
libcvaux-dev : Depends: libopencv-core-dev but it is not going to be installed
libopencv-calib3d-dev : Depends: libopencv-calib3d2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-contrib-dev : Depends: libopencv-contrib2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-features2d-dev : Depends: libopencv-features2d2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-flann-dev : Depends: libopencv-core-dev (= 2.3.1-7) but it is not going to be installed
Depends: libopencv-flann2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-highgui-dev : Depends: libopencv-highgui2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-imgproc-dev : Depends: libopencv-core-dev (= 2.3.1-7) but it is not going to be installed
Depends: libopencv-imgproc2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-legacy-dev : Depends: libopencv-legacy2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-ml-dev : Depends: libopencv-core-dev (= 2.3.1-7) but it is not going to be installed
Depends: libopencv-ml2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-objdetect-dev : Depends: libopencv-objdetect2.3 (= 2.3.1-7) but it is not going to be installed
libopencv-video-dev : Depends: libopencv-video2.3 (= 2.3.1-7) but it is not going to be installed
libplayerdrivers3.0 : Depends: libopencv-core2.3 but it is not going to be installed
Depends: libopencv-highgui2.3 but it is not going to be installed
Depends: libopencv-imgproc2.3 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
如果我嘗試運行建議的sudo apt-get -f install
,它會嘗試安裝上述所有內容,但它們都失敗並出現以下錯誤:
dpkg: error processing /var/cache/apt/archives/libopencv-video2.3_2.3.1-7_amd64.deb (--unpack):
trying to overwrite '/usr/lib/libopencv_video.so.2.3.1', which is also in package libopencv2.3 2.3.1+svn6514+branch23-12~oneiric
No apport report written because MaxReports is reached already
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
這裡發生了什麼事?據我所知,Box2D 沒有使用任何這些 OpenCV 軟體包(它是一個 2D 物理庫,而 OpenCV 是一個視覺處理庫),即使使用了,為什麼所有軟體包都損壞了?
答案1
事實證明這是使用的蹩腳存儲庫的錯誤涼亭。顯然,它提供的軟體包與標準儲存庫中的軟體包衝突。我刪除了它的 PPA 並卸載了所有損壞的軟體包,這解決了錯誤。
答案2
手動刪除所有 OpenCV 庫,然後嘗試執行以下命令。
須藤 dpkg -r libopencv*