运行 apt-get 时出错 - 软件包损坏

运行 apt-get 时出错 - 软件包损坏

apt-get install当我尝试在终端中运行任何程序时出现此错误:

$ sudo apt-get install -f 
Reading package lists... Done Building dependency tree        
Reading state information... 
Done Correcting dependencies... failed. 
The following packages have unmet dependencies:  
gstreamer1.0-plugins-bad : 
   Depends: gstreamer1.0-plugins-bad-videoparsers (= 1.8.3-1ubuntu0.2) but 1.2.4-1~ubuntu1.1 is installed
   Depends: gstreamer1.0-plugins-bad-faad (= 1.8.3-1ubuntu0.2) but it is not installed  
gstreamer1.0-plugins-bad-videoparsers : 
   Depends: libgstreamer-plugins-bad1.0-0 (= 1.2.4-1~ubuntu1.1) but 1.8.3-1ubuntu0.2 is installed  
jitsi:i386 : 
    Depends: default-jre:i386 but it is not installed or
                       java7-runtime:i386
              Depends: libappindicator1:i386 but it is not installed
              Depends: libspeex1:i386 but it is not installed
              Depends: jitsi-archive-keyring:i386 but it is not installable  libopencv-calib3d2.4v5 : Depends: libopencv-highgui2.4-deb0 but it is not installed  libopencv-contrib2.4v5 : Depends: libopencv-highgui2.4-deb0 (=
2.4.9.1+dfsg1-1) but it is not installed  libopencv-features2d2.4v5 : Depends: libopencv-highgui2.4-deb0 but it is not installed
                             Depends: libopencv-imgproc2.4v5 (= 2.4.9.1+dfsg1-1) but 2.4.9.1+dfsg-1.5ubuntu1 is installed  
libopencv-flann2.4v5 : 
  Depends: libopencv-core2.4v5 (=
2.4.9.1+dfsg1-1) but 2.4.9.1+dfsg-1.5ubuntu1 is installed  
libopencv-legacy2.4v5 : 
  Depends: libopencv-highgui2.4-deb0 (= 2.4.9.1+dfsg1-1) but it is not installed  
libopencv-ml2.4v5 : 
   Depends: libopencv-core2.4v5 (= 2.4.9.1+dfsg1-1) but 2.4.9.1+dfsg-1.5ubuntu1 is installed  
libopencv-objdetect2.4v5 : 
  Depends: libopencv-highgui2.4-deb0 (= 2.4.9.1+dfsg1-1) but it is not installed   
libopencv-video2.4v5 : 
  Depends: libopencv-imgproc2.4v5 (=
2.4.9.1+dfsg1-1) but 2.4.9.1+dfsg-1.5ubuntu1 is installed 
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages. 
E: Unable to correct dependencies

我正在使用 Ubuntu 16.04

我该如何解决这个问题?

答案1

尝试在终端上使用以下命令

sudo apt-get --fix-broken sudo apt-get --build-dep sudo apt-get check

答案2

这是一个奇怪的问题。评论其他答案中提到的对我来说不起作用。

虽然问题标题暗示了其他意思,但我认为这个问题

特别是关于安装吉特西,因此它对于缺少依赖项的一般情况不起作用。

报告缺少的依赖项是jitsi-archive-keyring,我发现https://download.jitsi.org/jitsi/debian/

https://download.jitsi.org/jitsi/debian/jitsi-archive-keyring_1.0.1_all.deb

因此下载后,我首先通过以下方式安装此包

sudo dpkg -i jitsi-archive-keyring_1.0.1_all.deb 

在安装 Jitsi 之前(2.10.5550-1 版本的 .deb 文件在这里) 通过

sudo dpkg -i jitsi_2.10.5550-1_amd64.deb

正如问题中提到的,使用

sudo apt-get install -f

每当上述某个dpkg调用由于依赖性错误而失败时,然后再次重试。

这帮我解决了 Xubuntu 16.04 上的这个问题。

相关内容