“无法配置 package:amd64,因为 package:i386 属于不同的版本”

“无法配置 package:amd64,因为 package:i386 属于不同的版本”

我尝试了很多方法,但仍然不知道如何解决这个问题。

我想更新服务器上的软件包。为此,我执行以下操作:

sudo apt-get update
sudo apt-get upgrade

然后我收到以下回复:

peter@blackbox:/etc/apt$ sudo apt-get upgrade
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:
 libavahi-common-data : Breaks: libavahi-common-data:i386 (!= 0.6.30-5ubuntu2) but 0.6.30-5ubuntu2.1 is installed
 libavahi-common-data:i386 : Breaks: libavahi-common-data (!= 0.6.30-5ubuntu2.1) but 0.6.30-5ubuntu2 is installed
E: Unmet dependencies. Try using -f.

按照说明进行操作:

peter@blackbox:/etc/apt$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  libcommons-jxpath-java libplexus-archiver-java libmaven-plugin-tools-java libcdi-api-java libplexus-containers-java linux-headers-3.2.0-44-generic linux-headers-3.2.0-39-generic libwagon-java libmodello-java
  linux-image-3.2.0-55-generic libsisu-guice-java libplexus-classworlds-java libmaven2-core-java libjtidy-java linux-image-3.2.0-37-generic linux-headers-3.2.0-52-generic libhttpclient-java libaspectj-java libservlet2.4-java
  libplexus-velocity-java linux-headers-3.2.0-32 linux-headers-3.2.0-33 linux-headers-3.2.0-40 linux-headers-3.2.0-35 linux-headers-3.2.0-36 linux-headers-3.2.0-37 linux-headers-3.2.0-43 linux-headers-3.2.0-38 linux-headers-3.2.0-44
  linux-headers-3.2.0-39 linux-headers-3.2.0-45 linux-headers-3.2.0-51 linux-headers-3.2.0-52 linux-headers-3.2.0-53 linux-headers-3.2.0-48 linux-headers-3.2.0-55 libcommons-jexl-java linux-headers-3.2.0-56 libosgi-compendium-java
  libplexus-cipher-java libguava-java libplexus-classworlds2-java libplexus-build-api-java libplexus-i18n-java linux-image-3.2.0-45-generic libnetty-java linux-headers-3.2.0-55-generic libplexus-interactivity-api-java libqdox-java
  libgeronimo-jpa-2.0-spec-java linux-headers-3.2.0-37-generic libcglib-java linux-image-3.2.0-53-generic linux-image-3.2.0-48-generic libxbean-java libcommons-net2-java libsaxon-java libdoxia-sitetools-java glassfish-javaee
  libitext1-java linux-image-3.2.0-40-generic libcommons-collections-java linux-headers-3.2.0-45-generic linux-image-3.2.0-56-generic libosgi-foundation-ee-java libasync-http-client-java libplexus-ant-factory-java libplexus-cli-java
  libplexus-container-default-java aspectj linux-headers-3.2.0-32-generic libeasymock-java linux-image-3.2.0-43-generic linux-image-3.2.0-38-generic linux-headers-3.2.0-53-generic linux-headers-3.2.0-48-generic fop libaopalliance-java
  libgeronimo-interceptor-3.0-spec-java libplexus-io-java libplexus-bsh-factory-java libclassworlds-java libplexus-interpolation-java libosgi-core-java linux-headers-3.2.0-40-generic linux-headers-3.2.0-35-generic
  linux-image-3.2.0-51-generic linux-headers-3.2.0-56-generic libhttpcore-java libcommons-httpclient-java libplexus-containers1.5-java libcommons-vfs-java linux-headers-3.2.0-43-generic linux-headers-3.2.0-38-generic libslf4j-java
  libasm3-java libjsoup-java libfop-java libaether-java libatinject-jsr330-api-java libsisu-ioc-java libcommons-configuration-java libmaven-reporting-impl-java velocity libxmlgraphics-commons-java linux-headers-3.2.0-51-generic
  libwerken.xpath-java libgeronimo-osgi-support-java libnetbeans-cvsclient-java libplexus-utils-java linux-headers-3.2.0-33-generic libplexus-sec-dispatcher-java libcommons-validator-java linux-image-3.2.0-44-generic
  linux-image-3.2.0-39-generic libmaven-scm-java libdoxia-java libcommons-digester-java libbatik-java libjetty-java libcommons-io-java libplexus-utils2-java linux-headers-3.2.0-36-generic libganymed-ssh2-java
  linux-image-3.2.0-52-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libavahi-common-data
The following packages will be upgraded:
  libavahi-common-data
1 upgraded, 0 newly installed, 0 to remove and 68 not upgraded.
8 not fully installed or removed.
Need to get 0 B/21.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? Y
dpkg: error processing libavahi-common-data (--configure):
 libavahi-common-data:amd64 0.6.30-5ubuntu2 cannot be configured because libavahi-common-data:i386 is in a different version (0.6.30-5ubuntu2.1)
dpkg: error processing libavahi-common-data:i386 (--configure):
 libavahi-common-data:i386 0.6.30-5ubuntu2.1 cannot be configured because libavahi-common-data:amd64 is in a different version (0.6.30-5ubuntu2)
dpkg: dependency problems prevent configuration of libavahi-common3:i386:
 libavahi-common3:i386 depends on libavahi-common-data; however:
  Package libavahi-common-data:i386 is not configured yet.
dpkg: error processing libavahi-common3:i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libavahi-common3:
 libavahi-common3 depends on libavahi-common-data; however:
  Package libavahi-common-data is not configured yet.
dpkg: error processing libavahi-common3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libavahi-client3:
 libavahi-client3 depends on libavahi-common3 (>= 0.6.22); however:
  Package libavahi-common3 is not configured yet.
dpkg: error processing libavahi-client3 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libavahi-client3:i386:
 libavahi-client3:i386 depends on libavahi-common3 (>= 0.6.22); No apport report written because the error message indicates its a followup error from a previous failure.
                                                                                                                                                                          No apport report written because the error message indicates its a followup error from a previous failure.
                                       No apport report written because MaxReports is reached already
                                                                                                     No apport report written because MaxReports is reached already
                                                                                                                                                                   however:
  Package libavahi-common3:i386 is not configured yet.
dpkg: error processing libavahi-client3:i386 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libavahi-core7:
 libavahi-core7 depends on libavahi-common3 (>= 0.6.16); however:
  Package libavahi-common3 is not configured yet.
dpkg: error processing libavahi-core7 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of avahi-daemon:
 avahi-daemon depends on libavahi-common3 (>= 0.6.16); however:
  Package libavahi-common3 is not configured yet.
 avahi-daemon depends on libavahi-core7 (>= 0.6.24); however:
  Package libavahi-core7 is not configured yet.
dpkg: error processing avahi-daemon (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 libavahi-common-data
 libavahi-common-data:i386
 libavahi-common3:i386
 libavahi-common3
 libavahi-client3
 libavahi-client3:i386
 libavahi-core7
 avahi-daemon
E: Sub-process /usr/bin/dpkg returned an error code (1)

有人知道如何解决这个问题吗?


更新2014年4月30日

正如 Avinash Raj 建议的那样,我保留了 libavahi-common-data 并运行了他的命令。我得到了以下结果:

peter@blackbox:~$ sudo apt-get autoremove
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:
 libavahi-common-data : Breaks: libavahi-common-data:i386 (!= 0.6.30-5ubuntu2) but     0.6.30-5ubuntu2.1 is installed
 libavahi-common-data:i386 : Breaks: libavahi-common-data (!= 0.6.30-5ubuntu2.1) but 0.6.30-5ubuntu2 is installed
E: Unmet dependencies. Try using -f.

peter@blackbox:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... failed.
The following packages have unmet dependencies:
 libavahi-common-data : Breaks: libavahi-common-data:i386 (!= 0.6.30-5ubuntu2) but 0.6.30-5ubuntu2.1 is installed
 libavahi-common-data:i386 : Breaks: libavahi-common-data (!= 0.6.30-5ubuntu2.1) but 0.6.30-5ubuntu2 is installed
E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.
E: Unable to correct dependencies

答案1

只需简单地按住该包libavahi-common-data即可阻止其升级,这样它就不会出现在软件包需要升级 列表。

sudo apt-mark hold libavahi-common-data

现在运行以下命令来删除所有未使用的包并修复依赖项,

sudo apt-get autoremove
sudo apt-get install -f

相关内容