如何解决与 libstdc++6 libstdc++6:i386 相关的 apt-get 升级问题?

如何解决与 libstdc++6 libstdc++6:i386 相关的 apt-get 升级问题?

我重新激活了装有 Ubuntu 14 的旧虚拟机。它立即向我展示了一系列更新,然后出现故障并告诉我:

检查您是否正在使用第三方存储库。如果是,请禁用它们,因为它们是问题的常见来源。此外,在终端中运行以下命令:apt-get install -f

运行建议的命令后,我得到以下结果:

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:
  antlr3 aspectj bsh default-jdk-doc gcj-4.8-jre-lib javahelp2 jetty jsvc
  junit4 junit4-doc libantlr-java libasm3-java libaspectj-java
  libbeansbinding-java libbetter-appframework-java libbindex-java libbsh-java
  libbytelist-java libcglib-java libcommons-beanutils-java
  libcommons-codec-java libcommons-collections3-java libcommons-compress-java
  libcommons-daemon-java libcommons-digester-java libcommons-net1-java
  libdb-java libdb-je-java libdb5.3-java libdb5.3-java-jni libeasymock-java
  libfelix-framework-java libfelix-main-java libflute-java libfreemarker-java
  libgcj-bc libgcj-common libgcj14 libgeronimo-jpa-2.0-spec-java
  libgeronimo-osgi-support-java libhamcrest-java libhamcrest-java-doc
  libicu4j-java libini4j-java libjcodings-java libjemmy2-java libjetty-java
  libjline-java libjna-java libjoda-convert-java libjoda-time-java
  libjtidy-java libjvyamlb-java libjzlib-java liblucene2-java libmysql-java
  libnb-absolutelayout-java libnb-apisupport3-java libnb-ide14-java
  libnb-java5-java libnb-javaparser-java libnb-org-openide-modules-java
  libnb-org-openide-util-java libnb-org-openide-util-lookup-java
  libnb-platform-devel-java libnb-platform13-java libnetx-java
  libosgi-compendium-java libosgi-core-java libosgi-foundation-ee-java
  libpostgresql-jdbc-java libsac-java libsac-java-gcj libsequence-library-java
  libservlet2.5-java libsimple-validation-java libslf4j-java libsqljet-java
  libstringtemplate-java libsvn-java libsvnclientadapter-java libsvnkit-java
  libswing-layout-java libswingx1-java libtrilead-ssh2-java libxz-java
  openjdk-7-doc
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libstdc++6 libstdc++6:i386
The following packages will be upgraded:
  libstdc++6 libstdc++6:i386
2 upgraded, 0 newly installed, 0 to remove and 518 not upgraded.
45 not fully installed or removed.
Need to get 0 B/528 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 245510 files and directories currently installed.)
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.3_amd64.deb ...
De-configuring libstdc++6:i386 (4.8.4-2ubuntu1~14.04.1) ...
Unpacking libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.3) over (4.8.4-2ubuntu1~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_amd64.deb (--unpack):
 trying to overwrite '/usr/share/gcc-4.8/python/libstdcxx/__init__.py', which is also in package libstdc++6-armhf-cross 4.8.4-2ubuntu1~14.04.1cross0.11.1
Preparing to unpack .../libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb ...
De-configuring libstdc++6:amd64 (4.8.4-2ubuntu1~14.04.1) ...
Unpacking libstdc++6:i386 (4.8.4-2ubuntu1~14.04.3) over (4.8.4-2ubuntu1~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb (--unpack):
 trying to overwrite '/usr/share/gcc-4.8/python/libstdcxx/__init__.py', which is also in package libstdc++6-armhf-cross 4.8.4-2ubuntu1~14.04.1cross0.11.1
Errors were encountered while processing:
 /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_amd64.deb
 /var/cache/apt/archives/libstdc++6_4.8.4-2ubuntu1~14.04.3_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我该如何解决这个问题?除了 Virtual Box 客户工具之外,我想我从未手动安装或更改过任何东西。它自己坏了。

编辑:apt sources.lst:

# deb cdrom:[Ubuntu 14.04.3 LTS _Trusty Tahr_ - Beta amd64 (20150805)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.


## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb http://nz.archive.ubuntu.com/ubuntu/ trusty-updates multiverse main universe restricted
deb http://security.ubuntu.com/ubuntu/ trusty-security multiverse main universe restricted
deb-src http://extras.ubuntu.com/ubuntu trusty main

编辑2:这解决了该问题:

sudo dpkg --force-all --purge libstdc++6-armhf-cross

答案1

从错误消息来看,您的系统中似乎混入了一些 armf 交叉编译。请尝试删除这些软件包,然后升级。

相关内容