apt-get命令因libpython3.3 unmet依赖而失败

操作系统:Ubuntu 14.04,amd_x64。

apt-get命令如install,remove和purge失败,错误与下面所示相同

但是updateclean等命令工作正常。

不确定如何解决问题。 看看我的终端会议。

 $ sudo apt-get install --reinstall lightdm Reading package lists... Building dependency tree... Reading state information... You might want to run 'apt-get -f install' to correct these: The following packages have unmet dependencies: libpython3.3 : Depends: python3.3 (= 3.3.6-1+trusty1) but 3.3.2-7ubuntu4 is to be installed E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution). 

 $ sudo apt-get -f install -y Reading package lists... Building dependency tree... Reading state information... Correcting dependencies... Done The following packages were automatically installed and are no longer required: evolution-common libevolution libgtkhtml-4.0-0 libgtkhtml-4.0-common libgtkhtml-editor-4.0-0 libkactivities-models1 libmail-spf-perl libnetaddr-ip-perl libpst4 libytnef0 re2c sa-compile spamassassin spamc Use 'apt-get autoremove' to remove them. The following extra packages will be installed: python3.3 python3.3-minimal Suggested packages: python3.3-doc The following packages will be upgraded: python3.3 python3.3-minimal 2 upgraded, 0 newly installed, 0 to remove and 108 not upgraded. 1 not fully installed or removed. Need to get 0 B/3,356 kB of archives. After this operation, 10.8 MB of additional disk space will be used. (Reading database ... 403449 files and directories currently installed.) Preparing to unpack .../python3.3_3.3.6-1+trusty1_amd64.deb ... Unpacking python3.3 (3.3.6-1+trusty1) over (3.3.2-7ubuntu4) ... dpkg: error processing archive /var/cache/apt/archives/python3.3_3.3.6-1+trusty1_amd64.deb (--unpack): trying to overwrite '/usr/lib/python3.3/asynchat.py', which is also in package libpython3.3-stdlib:amd64 3.3.2-7ubuntu4 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) dpkg: considering deconfiguration of python3.3, which would be broken by installation of python3.3-minimal ... dpkg: yes, will deconfigure python3.3 (broken by python3.3-minimal) Preparing to unpack .../python3.3-minimal_3.3.6-1+trusty1_amd64.deb ... De-configuring python3.3 (3.3.2-7ubuntu4) ... Unpacking python3.3-minimal (3.3.6-1+trusty1) over (3.3.2-7ubuntu4) ... dpkg: error processing archive /var/cache/apt/archives/python3.3-minimal_3.3.6-1+trusty1_amd64.deb (--unpack): trying to overwrite '/usr/lib/python3.3/sre_compile.py', which is also in package libpython3.3-minimal:amd64 3.3.2-7ubuntu4 dpkg-deb: error: subprocess paste was killed by signal (Broken pipe) Processing triggers for man-db (2.6.7.1-1) ... Processing triggers for gnome-menus (3.10.1-0ubuntu2) ... Processing triggers for desktop-file-utils (0.22-1ubuntu1) ... Processing triggers for bamfdaemon (0.5.1+14.04.20140409-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for mime-support (3.54ubuntu1) ... Errors were encountered while processing: /var/cache/apt/archives/python3.3_3.3.6-1+trusty1_amd64.deb /var/cache/apt/archives/python3.3-minimal_3.3.6-1+trusty1_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) 

 $ python --version Python 2.7.6 $ python3 --version Python 3.4.0 $ python3.3 --version Python 3.3.2+ 

显然没有人将不同版本的Python包标记为冲突。 因此, apt-get无法正确解析依赖关系,并以正确的顺序替换,删除和添加包。

作为一种解决方法,您可以在覆盖依赖性问题时手动删除冲突的包。 你可能需要玩一下订单(因为我不知道确切的依赖链在这里),但一般的想法是运行

 dpkg -r --force-depends libpython3.3-minimal libpython3.3-stdlib 

这可能会导致依赖于Python 3.3的应用程序或系统服务崩溃/中断,您可能需要在升级后重新启动它们。