将 Debian 更新至 Jessie 后 Python2.7 出现问题

将 Debian 更新至 Jessie 后 Python2.7 出现问题

在一个系统上运行 dist-upgrade 后,我收到此错误:

Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7 (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python:
 python depends on python2.7 (>= 2.7.9-1~); however:
  Package python2.7 is not configured yet.

执行手册时发生同样的错误dpkg -i

aleph /var/cache/apt/archives # dpkg -r python2.7
(Reading database ... 39002 files and directories currently installed.)
Removing python2.7 (2.7.9-2) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for mime-support (3.58) ...

aleph /var/cache/apt/archives # dpkg -i python2.7_2.7.9-2_amd64.deb 
(Reading database ... 39380 files and directories currently installed.)
Preparing to unpack python2.7_2.7.9-2_amd64.deb ...
Unpacking python2.7 (2.7.9-2) over (2.7.9-2) ...
Setting up python2.7 (2.7.9-2) ...
Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7 (--install):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for mime-support (3.58) ...
Processing triggers for man-db (2.7.0.2-5) ...
Errors were encountered while processing:
 python2.7

这也会破坏所有其他软件包(即rdiff-backupxen)。

我有点困惑,因为我在网上找不到任何明确的参考。我重启了服务器,尝试了 apt-get (auto)clean 等。一切似乎都很好(没有损坏的包或 fs?)。

下一步我可以尝试什么?

答案1

这是由损坏的文件引起的。

我安装了debsums,并在所有文件上运行了它。grepping 失败。

其中一个损坏的文件是topics.py/usr/lib/python2.7/pydoc_data/topics.py)。

我将文件从另一台正常工作的机器转移到那台机器,然后重新安装了 python2.7。

此后一切运行良好。

我还遇到了几个段错误(其他问题?)——重启后就消失了

相关内容