升级后依赖项损坏

apt-get upgrade我收到以下错误:

 Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 2 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y Setting up python3.3-minimal (3.3.1-1ubuntu5) ... Traceback (most recent call last): File "/usr/lib/python3.3/py_compile.py", line 8, in  import imp File "/usr/lib/python3.3/imp.py", line 28, in  import tokenize File "/usr/lib/python3.3/tokenize.py", line 28, in  import re File "/usr/lib/python3.3/re.py", line 122, in  import sre_compile File "/usr/lib/python3.3/sre_compile.py", line 14, in  import sre_parse File "/usr/lib/python3.3/sre_parse.py", line 17, in  from sre_constants import * File "/usr/lib/python3.3/sre_constants.py", line 18, in  from _sre import MAXREPEAT ImportError: cannot import name MAXREPEAT dpkg: error processing python3.3-minimal (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3.3: python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3.3 (--configure): dependency problems - leaving unconfigured No apport report written because the error message indicates its a followup error from a previous failure. Errors were encountered while processing: python3.3-minimal python3.3 E: Sub-process /usr/bin/dpkg returned an error code (1) 

而我无法关闭电脑……

我想我没有正确安装python 3.3,但我怎么能修复它?

编辑:我试过apt-get --reinstall install python2 python2-support但是我得到了:同样的错误

编辑:更多信息

在我的系统上:Linux Mycomputer 3.5.0-34-generic#55-Ubuntu SMP Thu Jun 6 20:20:19 UTC 2013 i686 i686 i686 GNU / Linux

 dpkg --print-architecture i386 

我曾经有过ubuntu 12.10。 当我尝试将其升级到13.04时,我的问题出现了。 我有一条错误消息告诉我进程停止,因为错误太多了。

然后我尝试运行sudo apt-get update && sudo apt-get upgrade但遇到上面的错误。

几个月前,当我错误地从计算机中删除python2时,我遇到了类似的问题。 然后我无法通过点击图标(它没有响应)并关闭来关闭我的电脑。 唯一的方法是强制它手动关闭。 当我再次打开它时,我只有一个空的桌面,无法做任何事情。 通过重新安装整个系统来解决这个问题。

在互联网上搜索,我尝试了几个命令:

 sudo dpkg --configure -a 

结果导致了

 Setting up python3.3-minimal (3.3.1-1ubuntu5) ... Traceback (most recent call last): File "/usr/lib/python3.3/py_compile.py", line 8, in  import imp File "/usr/lib/python3.3/imp.py", line 28, in  import tokenize File "/usr/lib/python3.3/tokenize.py", line 28, in  import re File "/usr/lib/python3.3/re.py", line 122, in  import sre_compile File "/usr/lib/python3.3/sre_compile.py", line 14, in  import sre_parse File "/usr/lib/python3.3/sre_parse.py", line 17, in  from sre_constants import * File "/usr/lib/python3.3/sre_constants.py", line 18, in  from _sre import MAXREPEAT ImportError: cannot import name MAXREPEAT dpkg: error processing python3.3-minimal (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3-minimal: python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however: Package python3.3-minimal is not configured yet. sudo apt-get --reinstall install python3 python3-support Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package python3-support sudo apt-get -f install Reading package lists... Done Building dependency tree Reading state information... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Setting up python3.3-minimal (3.3.1-1ubuntu5) ... Traceback (most recent call last): File "/usr/lib/python3.3/py_compile.py", line 8, in  import imp File "/usr/lib/python3.3/imp.py", line 28, in  import tokenize File "/usr/lib/python3.3/tokenize.py", line 28, in  import re File "/usr/lib/python3.3/re.py", line 122, in  import sre_compile File "/usr/lib/python3.3/sre_compile.py", line 14, in  import sre_parse File "/usr/lib/python3.3/sre_parse.py", line 17, in  from sre_constants import * File "/usr/lib/python3.3/sre_constants.py", line 18, in  from _sre import MAXREPEAT ImportError: cannot import name MAXREPEAT dpkg: error processing python3.3-minimal (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3-minimal: python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3.3: python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3.3 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3: python3 depends on python3.3 (>= 3.3.1-1~); however: Package python3.3 is not configured yet. python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however: Package python3-minimal is not configured yet. dpkg: error processing python3 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3.3-minimal python3-minimal python3.3 python3 E: Sub-process /usr/bin/dpkg returned an error code (1) dpkg: error processing python3-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3: python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however: Package python3-minimal is not configured yet. dpkg: error processing python3 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3.3: python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3.3 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3.3-minimal python3-minimal python3 python3.3 python --version 

返回Python 2.7.4

这样做:

 cd /tmp sudo apt-get download python3 sudo dpkg -i python3*.deb && apt-get dist-upgrade 

回报

  (Reading database ... 374310 files and directories currently installed.) Preparing to replace python3 3.3.1-0ubuntu1 (using python3_3.3.1-0ubuntu1_i386.deb) ... running python pre-rtupdate hooks for python3.3... Unpacking replacement python3 ... dpkg: dependency problems prevent configuration of python3: python3 depends on python3.3 (>= 3.3.1-1~); however: Package python3.3 is not configured yet. python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however: Package python3-minimal is not configured yet. dpkg: error processing python3 (--install): dependency problems - leaving unconfigured Processing triggers for man-db ... Errors were encountered while processing: python3 

我也尝试删除并重新安装python3

有什么帮助吗?

在Gx1sptDTDa的回答后编辑

 sudo apt-get clean sudo apt-get dist-upgrade Reading package lists... Done Building dependency tree Reading state information... Done Calculating upgrade... Done 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y Setting up python3.3-minimal (3.3.1-1ubuntu5) ... Traceback (most recent call last): File "/usr/lib/python3.3/py_compile.py", line 8, in  import imp File "/usr/lib/python3.3/imp.py", line 28, in  import tokenize File "/usr/lib/python3.3/tokenize.py", line 28, in  import re File "/usr/lib/python3.3/re.py", line 122, in  import sre_compile File "/usr/lib/python3.3/sre_compile.py", line 14, in  import sre_parse File "/usr/lib/python3.3/sre_parse.py", line 17, in  from sre_constants import * File "/usr/lib/python3.3/sre_constants.py", line 18, in  from _sre import MAXREPEAT ImportError: cannot import name MAXREPEAT dpkg: error processing python3.3-minimal (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3-minimal: python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3.3: python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3.3 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3: python3 depends on python3.3 (>= 3.3.1-1~); however: Package python3.3 is not configured yet. python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however: Package python3-minimal is not configured yet. dpkg: error processing python3 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3.3-minimal python3-minimal python3.3 python3 E: Sub-process /usr/bin/dpkg returned an error code (1) 

编辑:安装python3.3-minimal的所有依赖项

 sudo apt-get install libc6 libexpat1 libpython3.3-minimal zlib1g 

回报

 Reading package lists... Done Building dependency tree Reading state information... Done libc6 is already the newest version. libexpat1 is already the newest version. libpython3.3-minimal is already the newest version. libpython3.3-minimal set to manually installed. zlib1g is already the newest version. 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 4 not fully installed or removed. After this operation, 0 B of additional disk space will be used. Do you want to continue [Y/n]? y Setting up python3.3-minimal (3.3.1-1ubuntu5) ... Traceback (most recent call last): File "/usr/lib/python3.3/py_compile.py", line 8, in  import imp File "/usr/lib/python3.3/imp.py", line 28, in  import tokenize File "/usr/lib/python3.3/tokenize.py", line 28, in  import re File "/usr/lib/python3.3/re.py", line 122, in  import sre_compile File "/usr/lib/python3.3/sre_compile.py", line 14, in  import sre_parse File "/usr/lib/python3.3/sre_parse.py", line 17, in  from sre_constants import * File "/usr/lib/python3.3/sre_constants.py", line 18, in  from _sre import MAXREPEAT ImportError: cannot import name MAXREPEAT dpkg: error processing python3.3-minimal (--configure): subprocess installed post-installation script returned error exit status 1 dpkg: dependency problems prevent configuration of python3-minimal: python3-minimal depends on python3.3-minimal (>= 3.3.1-1~); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3-minimal (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3.3: python3.3 depends on python3.3-minimal (= 3.3.1-1ubuntu5); however: Package python3.3-minimal is not configured yet. dpkg: error processing python3.3 (--configure): dependency problems - leaving unconfigured dpkg: dependency problems prevent configuration of python3: python3 depends on python3.3 (>= 3.3.1-1~); however: Package python3.3 is not configured yet. python3 depends on python3-minimal (= 3.3.1-0ubuntu1); however: Package python3-minimal is not configured yet. dpkg: error processing python3 (--configure): dependency problems - leaving unconfigured Errors were encountered while processing: python3.3-minimal python3-minimal python3.3 python3 E: Sub-process /usr/bin/dpkg returned an error code (1) 

编辑:sudo dbkg-reconfigure -a

1 /问:────────────────────────────────────────────────────────────────────────────────────────────────── ──────────────────┐
││
│默认情况下,│上的所有用户都可以读取用户的主目录
│系统。 如果您想增加安全性和隐私,您可能需要│
│主目录只能为其所有者读取。 但如果有疑问,│
│启用此选项。 │
││
│这只会影响从现在开始用│添加的用户的主目录
│adduser命令。 │
││
│您想要系统范围的可读主目录吗?

说是的

2 /┤配置apparmor├──────────────────────
│请为用户│输入空格分隔的任何其他位置列表
│主目录。 这些位置是│中指定的位置的补充
│/etc/apparmor.d/tunables/home并且必须以’/’结尾。 │
││
│示例:如果用户的目录存储在/ srv / nfs / home和│中
│/ mnt / homes,你应该输入“/ srv / nfs / home / / mnt / homes /”。 │
││
│其他主目录位置:

我不知道要指出的位置…所以我只是通过了

最后,我读了shell:

 update-rc.d: warning: /etc/init.d/acpi-support missing LSB information update-rc.d: see  acpid stop/waiting acpid start/running, process 24816 * Starting AppArmor profiles Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd [ OK ] * Reloading AppArmor profiles Skipping profile in /etc/apparmor.d/disable: usr.bin.firefox Skipping profile in /etc/apparmor.d/disable: usr.sbin.rsyslogd [ OK ] gpg: key 437D05B5: "Ubuntu Archive Automatic Signing Key " not changed gpg: key FBB75451: "Ubuntu CD Image Automatic Signing Key " not changed gpg: key C0B21F32: "Ubuntu Archive Automatic Signing Key (2012) " not changed gpg: key EFE21092: "Ubuntu CD Image Automatic Signing Key (2012) " not changed gpg: Total number processed: 4 gpg: unchanged: 4 Unknown media type in type 'all/all' Unknown media type in type 'all/allfiles' Unknown media type in type 'uri/mms' Unknown media type in type 'uri/mmst' Unknown media type in type 'uri/mmsu' Unknown media type in type 'uri/pnm' Unknown media type in type 'uri/rtspt' Unknown media type in type 'uri/rtspu' /usr/sbin/dpkg-reconfigure: asymptote is broken or not fully installed 

编辑:Synaptic在synaptic上,没有显示“破坏的依赖关系”(我点击状态,我只能看到:所有已安装的已安装(本地或已过时)已安装(手动)未安装未安装(残余配置)

编辑

该问题与以下错误报告有关: https : //bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1165281

按照注释#3到#5中的步骤操作,但将路径更改为python3.3而不是2.7。

我有一个不同的包,libamd2.3.1:amd64同样的问题。 我收到了这个错误:

 > sudo apt upgrade [...] Errors were encountered while processing: libamd2.3.1:amd64 E: Sub-process /usr/bin/dpkg returned an error code (1) 

在这个post之后,我设法用dpkg删除它并用apt重新安装。

 sudo dpkg --remove --force-remove-reinstreq libamd2.3.1:amd64 sudo apt-get install libamd2.3.1:amd64