Raspbian Jessi apt-get install python2.7-minimal configure错误

时间:2016-10-26 10:14:32

标签: python-2.7 raspbian apt-get

我已经安装了Raspbian Jessi和Seafile,它依赖于python2.7,由我自己安装作为此过程的一部分。当它处于无头模式时,几周工作正常。通过ssh手动运行后

sudo apt-get update && sudo apt-get upgrade

更新过程失败,配置错误为python2.7-minimal。输出是:

sudo apt-get install python2.7 python2.7-minimal
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following package was automatically installed and is no longer required:
  libpython-stdlib
Use 'apt-get autoremove' to remove it.
Suggested packages:
  python2.7-doc binfmt-support
The following NEW packages will be installed:
  python2.7 python2.7-minimal
0 upgraded, 2 newly installed, 0 to remove and 3 not upgraded.
Need to get 0 B/1,402 kB of archives.
After this operation, 3,595 kB of additional disk space will be used.
y
Selecting previously unselected package python2.7-minimal.
(Reading database ... 107629 files and directories currently installed.)
Preparing to unpack .../python2.7-minimal_2.7.9-2+deb8u1_armhf.deb ...
Unpacking python2.7-minimal (2.7.9-2+deb8u1) ...
Selecting previously unselected package python2.7.
Preparing to unpack .../python2.7_2.7.9-2+deb8u1_armhf.deb ...
Unpacking python2.7 (2.7.9-2+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for gnome-menus (3.13.3-6) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.58) ...
Setting up python2.7-minimal (2.7.9-2+deb8u1) ...
Sorry: TypeError: compile() expected string without null bytesdpkg: error processing package python2.7-minimal (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of python2.7:
 python2.7 depends on python2.7-minimal (= 2.7.9-2+deb8u1); however:
  Package python2.7-minimal is not configured yet.

dpkg: error processing package python2.7 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 python2.7-minimal
 python2.7
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试了几种apt-get remove / purge,dpkg reconfigure等组合,但错误是持久的。

另一件事:

apt-cache policy python2.7-minimal python2.7
python2.7-minimal:
  Installed: 2.7.9-2+deb8u1
  Candidate: 2.7.9-2+deb8u1
  Version table:
 *** 2.7.9-2+deb8u1 0
        500 http://mirrordirector.raspbian.org/raspbian/ jessie/main armhf Packages
        100 /var/lib/dpkg/status
python2.7:
  Installed: 2.7.9-2+deb8u1
  Candidate: 2.7.9-2+deb8u1
  Version table:
 *** 2.7.9-2+deb8u1 0
        500 http://mirrordirector.raspbian.org/raspbian/ jessie/main armhf Packages
        100 /var/lib/dpkg/status

我不是初学者,也不是Linux的专家。如果您需要任何进一步的信息来回答这个问题,请告诉我。请帮助,因为我厌倦了这样的战斗。

1 个答案:

答案 0 :(得分:0)

根据this post on ServerFaultthis blog,您的本地文件可能存在问题(损坏,配置错误等)。你说你试过清除软件包,但由于我不确定你尝试了什么,我建议用def test_anagram(): strings = [("plane","panel"),("traps","parts"),("state","man"), ("nails","snail"),("reset","trees"),("later","alert")] strings for str1,str2 in strings: print(str1,str2) # print each string print(anagram(str1,str2)) 清除所有python软件包,然后根据需要重新安装它们。
值得注意的是,任何人都不知道sudo apt purge python*将完全卸载包,包括配置文件。除非你了解风险,否则不要这样做。