使用 apt 遇到未满足的依赖关系循环问题

使用 apt 遇到未满足的依赖关系循环问题

我试图在新升级的 18.04(从 16.04 开始)上使用包做一些事情,但我总是被一堆具有未满足的依赖关系的包阻止。这是我尝试安装软件包时的输出:

adamthedog@adam-linux:~$ sudo apt install *any package*
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libasan2-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libasan4-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libatomic1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libcilkrts5-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libgcc1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libgomp1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libstdc++6-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libubsan0-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 ubuntu-app-launch : Depends: upstart (>= 1.13) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

如果我尝试这样做sudo apt --fix-broken 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:
  account-plugin-facebook account-plugin-flickr account-plugin-google alsa-firmware alsa-firmware-loaders alsa-tools apparmor-easyprof-ubuntu apt-config-icons-large apt-config-icons-large-hidpi arctican-plugins-vst artyfx buteo-sync-plugins-contacts-google buteo-syncfw
  cgmanager click click-apparmor cmake-data content-hub cpp-5-arm-linux-gnueabihf cryptsetup-bin dexed-vst discover discover-data distrho-plugin-ports-vst drmr drowaudio-plugins-vst dssi-example-plugins dssi-utils easyssp-vst emacs24-bin-common emacs24-common
  emacs24-common-non-dfsg emacs24-el esound-common fabla firebird2.5-common-doc fonts-horai-umefont fonts-unfonts-core foo-yc20-vst freerdp-x11 fxload g++-5-arm-linux-gnueabihf gcc-5-arm-linux-gnueabihf gcc-5-arm-linux-gnueabihf-base gcc-5-base:i386 gcc-5-cross-base
  gcc-6-base:i386 gir1.2-accounts-1.0 gir1.2-click-0.4 gir1.2-javascriptcoregtk-3.0 gir1.2-signon-1.0 gir1.2-webkit-3.0 gnome-characters gnome-icon-theme-symbolic gnome-keyring-pkcs11:i386 gnome-packagekit-data gnome-weather golang-1.6 golang-1.6-doc golang-1.6-go
  golang-1.6-race-detector-runtime golang-1.6-src gstreamer0.10-gnomevfs gxvoxtonebender infamous-plugins jackass kde-style-qtcurve-qt4 kde-style-qtcurve-qt5 kdepim-doc klangfalter-vst kubuntu-restricted-addons kubuntu-restricted-extras libaccount-plugin-1.0-0
  libaccount-plugin-generic-oauth libaccount-plugin-google libappstream3 libappstreamqt1 libasan2-armhf-cross libbind9-140 libblas-common libboost-atomic1.58.0 libboost-chrono1.58.0 libboost-date-time1.58.0 libboost-iostreams1.58.0 libboost-log1.58.0
  libboost-python1.58.0 libboost-random1.58.0 libboost-serialization1.58.0 libboost-signals1.58.0 libbotan-1.10-1 libbuteosyncfw5-0 libc6-dev:i386 libcamel-1.2-54 libcapnp-0.5.3 libcfitsio2 libcgal11v5 libcgmanager0 libchromaprint0 libclang1-3.6 libclick-0.4-0
  libclutter-gst-2.0-0 libconfig-file-perl libconfuse-common libcontent-hub0 libcryptui0a libcupti7.5 libdata-alias-perl libdbus-cpp5 libdcmtk5 libdevmapper1.02.1:i386 libdirectfb-1.2-9 libdiscover2 libdns162 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386
  libdrm-radeon1:i386 libdrm2:i386 libebook-1.2-16 libedataserver-1.2-21 libedataserverui-1.2-1 libedit2:i386 libelf1:i386 libesd0 libespeak1 libevent-core-2.0-5 libevent-extra-2.0-5 libevent-openssl-2.0-5 libevent-pthreads-2.0-5 libfcitx-gclient0 libfreerdp-cache1.1
  libfreerdp-client1.1 libfreerdp-codec1.1 libfreerdp-common1.1.0 libfreerdp-core1.1 libfreerdp-crypto1.1 libfreerdp-gdi1.1 libfreerdp-locale1.1 libfreerdp-plugins-standard libfreerdp-primitives1.1 libfreerdp-rail1.1 libfreerdp-utils1.1 libfwupd1
  libgcc-5-dev-armhf-cross libgcr-3-common libghc-old-locale-dev libghc-old-locale-prof libghc-old-time-dev libghc-old-time-prof libgif7:i386 libgit2-24 libgl2ps0 libglapi-mesa:i386 libglvnd0:i386 libgmime-2.6-0 libgnome-desktop-3-12 libgoogle-glog0v5 libgps22
  libgranite2 libgweather-3-6 libhardware2 libhdf5-10 libhdf5-cpp-11 libhttp-parser2.1 libhud2 libhunspell-1.3-0 libhybris libical1a libicu55:i386 libidn11:i386 libidn11-dev libiphb0 libisccfg140 libiscsi2 libiso9660-8 libjasper-dev libjavascriptcoregtk-3.0-0
  libjavascriptcoregtk-4.0-dev libjpeg9 libk3b6 libk3b6-extracodecs libk3b7 libk3b7-extracodecs libkcddb4 libkcompactdisc4 libkf5activitiesexperimentalstats1 libkf5calendarcore5 libkf5cddb-data libkf5cddb5 libkf5gpgmepp-pthread5 libkf5gpgmepp5 libkf5identitymanagement5
  libkf5kdgantt2-5 libkf5kipi30.0.0 libkf5libkleo5 libkf5mime5 libkf5pimtextedit5 libkf5prison1 libkf5qgpgme5 libkwineffects7 libkwinglutils7 libkwinxrenderutils7 liblensfun-data liblensfun0 liblibertine1 liblink-grammar4 liblircclient0 liblivemedia50 libllvm3.6v5
  libllvm4.0 libllvm6.0:i386 liblouis9 liblouisutdml6 liblttng-ust-ctl2 liblttng-ust-ctl4 liblttng-ust0 liblwres141 libmedia1 libmono-c5-1.1-cil libmonoboehm-2.0-1 libmonoboehm-2.0-dev libmozjs-24-0v5 libnet-cpp2 libnfs8 liboce-foundation10 liboce-modeling10
  liboce-ocaf-lite10 liboce-ocaf10 liboce-visualization10 libode4 libokularcore7 libonline-accounts-client1 libopencv-gpu2.4v5 libopencv-legacy2.4v5 libopencv-ocl2.4v5 libopencv-photo2.4v5 libopencv-stitching2.4v5 libopencv-superres2.4v5 libopencv-ts2.4v5
  libopencv-videostab2.4v5 libopencv2.4-jni liborcus-0.10-0v5 libp11-kit-gnome-keyring libp11-kit-gnome-keyring:i386 libpackagekitqt5-0 libpciaccess0:i386 libpng12-0:i386 libpodofo0.9.3 libpoppler-qt4-4 libpoppler58 libportaudiocpp0 libprocess-cpp3 libprotobuf9v5
  libprotoc9v5 libpython3.5-dev libqbscore1 libqbsqtprofilesetup1 libqcustomplot1.3 libqmobipocket1 libqt5clucene5 libqt5contacts5 libqt5feedback5 libqt5organizer5 libqt5systeminfo5 libqtcurve-utils2 libquvi-scripts libquvi7 libraptor1 librhash0 librpm3 librpmbuild3
  librpmio3 librpmsign3 libsensors4:i386 libsidutils0 libsignon-extension1 libsignon-glib1 libsodium18 libsoup2.4-dev libsox2 libspice-client-gtk-3.0-4 libssl1.0.0:i386 libstdc++-5-dev-armhf-cross libthumbnailer-qt1.0 libtorrent-rasterbar8 libtrust-store2
  libtxc-dxtn-s2tc0 libtxc-dxtn-s2tc0:i386 libubuntu-app-launch2 libubuntu-download-manager-client1 libubuntu-download-manager-common1 libubuntu-location-service3 libudm-common1 libudm-priv-common1 libuninameslist0 libunity-action-qt1 libunity-api0 libunity-scopes1.0
  liburcu4 liburcu6 libva-drm1 libvamp-sdk2v5 libvirt-bin libvpx3:i386 libvte-common libvte9 libwebkit2gtk-4.0-dev libwebkitgtk-3.0-0 libwebpdemux1 libwebpmux1 libwebrtc-audio-processing-0 libwinpr-crt0.1 libwinpr-dsparse0.1 libwinpr-environment0.1 libwinpr-file0.1
  libwinpr-handle0.1 libwinpr-heap0.1 libwinpr-input0.1 libwinpr-interlocked0.1 libwinpr-library0.1 libwinpr-path0.1 libwinpr-pool0.1 libwinpr-registry0.1 libwinpr-rpc0.1 libwinpr-sspi0.1 libwinpr-synch0.1 libwinpr-sysinfo0.1 libwinpr-thread0.1 libwinpr-utils0.1
  libx11-xcb1:i386 libxapian-1.3-5 libxapian22v5 libxcb-dri2-0:i386 libxcb-dri3-0:i386 libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxen-4.6 libxfont1 libxfont1-dev libxfreerdp-client1.1 libxshmfence1:i386 libxt6:i386 libzita-alsa-pcmi0 libzita-resampler1
  libzmqpp3 linux-headers-4.4.0-186 linux-headers-4.4.0-186-generic linux-image-4.4.0-186-generic linux-libc-dev:i386 linux-modules-4.4.0-186-generic linux-modules-extra-4.4.0-186-generic linuxsampler-vst llvm-4.0 llvm-4.0-dev llvm-4.0-runtime lufsmeter-vst luftikus-vst
  lv2-dev mda-vst mod-sdk-lv2 moony.lv2 obxd-vst openjdk-8-doc oxefmsynth oxideqt-codecs-extra p11-kit-modules:i386 pitcheddelay-vst pizmidi-plugins prosper python-feedparser python-ndg-httpsclient python-utidylib python-yenc python3-apparmor-click python3-click-package
  python3-dbus.mainloop.qt python3-plainbox python3-pyqt4 python3.5-dev qml-module-qtfeedback qml-module-qttest qml-module-ubuntu-onlineaccounts-client qml-module-ubuntu-performancemetrics qml-module-ubuntu-thumbnailer0.1 qtdeclarative5-accounts-plugin
  qtdeclarative5-online-accounts-client0.1 qtdeclarative5-test-plugin qtdeclarative5-ubuntu-content1 qtdeclarative5-ubuntu-download-manager0.1 qtdeclarative5-ubuntu-thumbnailer0.1 qtdeclarative5-unity-action-plugin qtdeclarative5-unity-notifications-plugin rename
  rtirq-init rubberband-lv2 rubberband-vamp ruby2.3 seahorse-daemon sherlock.lv2 signon-plugin-password signon-ui signon-ui-service signon-ui-x11 signond sorcer suru-icon-theme tal-plugins-vst tcpd teragonaudio-plugins-vst thumbnailer-service ttf-alee ttf-wqy-microhei
  ubuntu-app-launch ubuntu-download-manager ubuntu-mobile-icons ubuntu-release-upgrader-qt unity-plugin-scopes unity-scope-gdrive url-dispatcher vamp-examples whysynth wine-gecko2.21:i386 wine-gecko2.21 wine-mono0.0.8 wine1.6-i386:i386 wolpertinger-vst wsynth-dssi
  x11proto-bigreqs-dev x11proto-xcmisc-dev x42-plugins xsynth-dssi yudit-common
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libc6-armhf-cross libc6-dev-armhf-cross ubuntu-app-launch
The following packages will be upgraded:
  libc6-armhf-cross libc6-dev-armhf-cross ubuntu-app-launch
3 upgraded, 0 newly installed, 0 to remove and 51 not upgraded.
19 not fully installed or removed.
Need to get 0 B/2,918 kB of archives.
After this operation, 111 kB disk space will be freed.
Do you want to continue? [Y/n] y
(Reading database ... 965024 files and directories currently installed.)
Preparing to unpack .../libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-dev-armhf-cross (2.27-3ubuntu1cross1.1) over (2.23-0ubuntu3cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabihf/lib/Mcrt1.o.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Preparing to unpack .../libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb ...
Unpacking libc6-armhf-cross (2.27-3ubuntu1cross1.1) over (2.23-0ubuntu3cross1) ...
dpkg: error processing archive /var/cache/apt/archives/libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb (--unpack):
 unable to open '/usr/arm-linux-gnueabihf/lib/ld-2.27.so.dpkg-new': No such file or directory
No apport report written because the error message indicates an issue on the local system
                                                                                         Preparing to unpack .../ubuntu-app-launch_0.12+17.04.20170404.2-0ubuntu6_amd64.deb ...
Traceback (most recent call last):
  File "/usr/bin/click", line 37, in <module>
    import click_package as click
ModuleNotFoundError: No module named 'click_package'
dpkg: warning: old ubuntu-app-launch package pre-removal script subprocess returned error exit status 1
dpkg: trying script from the new package instead ...
dpkg: error processing archive /var/cache/apt/archives/ubuntu-app-launch_0.12+17.04.20170404.2-0ubuntu6_amd64.deb (--unpack):
 there is no script in the new version of the package - giving up
Errors were encountered while processing:
 /var/cache/apt/archives/libc6-dev-armhf-cross_2.27-3ubuntu1cross1.1_all.deb
 /var/cache/apt/archives/libc6-armhf-cross_2.27-3ubuntu1cross1.1_all.deb
 /var/cache/apt/archives/ubuntu-app-launch_0.12+17.04.20170404.2-0ubuntu6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

如果我尝试删除导致 dpkg 错误的软件包(例如libc6-dev-armhf-cross),apt 会告诉我...我不能,因为我有未满足的依赖项...即libc6-dev-armhf-cross

adamthedog@adam-linux:~$ sudo apt purge libc6-dev-armhf-cross 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
 libasan2-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libasan4-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libatomic1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libc6-dev-armhf-armel-cross : Depends: libc6-dev-armhf-cross but it is not going to be installed
 libcilkrts5-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libgcc1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libgomp1-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libstdc++-5-dev-armhf-cross : Depends: libc6-dev-armhf-cross (>= 2.13-0ubuntu6) but it is not going to be installed
 libstdc++-7-dev-armhf-cross : Depends: libc6-dev-armhf-cross (>= 2.13-0ubuntu6) but it is not going to be installed
 libstdc++6-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 libubsan0-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed
 ubuntu-app-launch : Depends: upstart (>= 1.13) but it is not installable
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我该怎么办?

答案1

我认为关键在于您写的最后一条错误消息的这一行:

libasan2-armhf-cross : Depends: libc6-armhf-cross (>= 2.27) but 2.23-0ubuntu3cross1 is to be installed

当它说时,这意味着已知的2.23-0ubuntu3cross1 is to be installed版本是.因此,如果你这样做,你就会得到。不幸的是,这还不够,因为 apt 正在安装其他需要.libc6-armhf-crossapt2.23-...apt install libc6-armhf-cross2.23-...(>= 2.27)

有几种情况可能会导致这种情况:

  1. 如果您尝试*.deb直接从较新版本的 ubuntu 或不支持您的版本(套件)的 PPA 安装。 deb 可能不支持您的版本中提供的依赖项。在这种情况下,请尝试安装适合您的特定套件的版本。
  2. 您可能只需要从存储库下载最新的版本信息,以便您知道所有内容的当前版本是什么。apt update为拿到它,为实现它
  3. 您正在升级您的套件,您也许可以使用 解决此问题apt dist-upgrade。从自动删除的数量来看,我怀疑可能是这种情况。
  4. 固定可能会严重破坏系统。如果您有任何内容,/etc/apt/preferences.d/请将其添加到您的问题中。其中包含一些规则,例如优先考虑一个版本而不是另一个版本。

无论哪种方式,编辑您的答案以包括输出cat /etc/apt/sources.list /etc/apt/sources.list.d/*.list以及有关您最近是否更改的任何信息都会很有用。

我发现当我进行套件升级时,最简单的方法是不断切换以下命令,直到一切正常。只要您的源和固定配置正确,这通常可以解决问题:

apt update
apt upgrade
apt dist-upgrade
apt --fix-broken install

相关内容