apt-get 给出“子进程 /usr/bin/dpkg 返回错误代码”

apt-get 给出“子进程 /usr/bin/dpkg 返回错误代码”

所以我尝试在我的 Debian 机器上安装 Cython,在安装过程中它给了我错误代码:

 Sub-process /usr/bin/dpkg returned an error code (1)

现在我作为一个纯血统的专业学生,刚睡醒之后,就没有多想,觉得以后再看吧。但是现在当尝试安装任何东西或更新时,apt-get 给了我以下内容

Errors were encountered while processing:
cython
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo dpkg --configure -a 给出以下内容

Setting up cython (0.25.2-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package cython (--configure):
  subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 cython

sudo apt-get install -f

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 30 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up cython (0.25.2-1) ...
Traceback (most recent call last):
  File "/usr/bin/pycompile", line 35, in <module>
    from debpython.version import SUPPORTED, debsorted, vrepr, \
  File "/usr/share/python/debpython/version.py", line 24, in <module>
    from ConfigParser import SafeConfigParser
ImportError: No module named 'ConfigParser'
dpkg: error processing package cython (--configure):
  subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
  cython
E: Sub-process /usr/bin/dpkg returned an error code (1)

猫 /etc/apt/sources.list

#------------------------------------------------------------------------------#
#                   OFFICIAL DEBIAN REPOS
#------------------------------------------------------------------------------#

###### Debian Main Repos
deb http://deb.debian.org/debian/ stable main contrib
deb-src http://deb.debian.org/debian/ stable main contrib

deb http://deb.debian.org/debian/ stable-updates main contrib
deb-src http://deb.debian.org/debian/ stable-updates main contrib

deb http://deb.debian.org/debian-security stable/updates main
deb-src http://deb.debian.org/debian-security stable/updates main

deb http://ftp.debian.org/debian stretch-backports main
deb-src http://ftp.debian.org/debian stretch-backports main

答案1

要解除阻止apt,您需要删除该cython软件包:

sudo apt purge cython

修复cython安装可能会涉及更多一些(请参阅问题评论)。

相关内容