操作系统:Ubuntu 14.04,amd_x64。
apt-get
安装、删除和清除等命令会失败,并出现如下所示的相同错误
update
但是像和这样的命令clean
可以正常工作。
不确定如何解决这个问题。看看我的终端会话。
$ 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+
答案1
显然没有人将不同版本的 Python 软件包标记为冲突。因此apt-get
无法正确解决依赖关系并以正确的顺序替换、删除和添加软件包。
作为一种解决方法,您可以手动删除冲突的软件包,同时覆盖依赖关系问题。您可能需要对顺序进行一些调整(因为我不知道这里确切的依赖链),但一般的想法是运行
dpkg -r --force-depends libpython3.3-minimal libpython3.3-stdlib
这可能会使依赖 Python 3.3 的正在运行的应用程序或系统服务崩溃/中断,您可能需要在升级后重新启动它们。