处理时遇到错误:python-gtk2-dev

处理时遇到错误:python-gtk2-dev

我的包裹出了问题,我尝试了两天却没有任何结果。

当我尝试更新或安装任何软件包时出现此错误:

Setting up python-gtk2-dev (2.24.0-4ubuntu1) ...

File "/usr/bin/pyversions", line 20

except IOError, msg:

              ^

SyntaxError: invalid syntax

dpkg: error processing package python-gtk2-dev (--configure):

subprocess installed post-installation script returned error exit status 1  Errors were encountered while processing:

python-gtk2-dev

我不知道该包(python-gtk2-dev)是否已安装,我尝试检查它:

satti@ubuntu:~ $ dpkg -l python-gtk2-dev

Desired=Unknown/Install/Remove/Purge/Hold

| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend

|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)

||/ Name           Version      Architecture Description

+++-==============-============-============-=================================

iF  python-gtk2-de 2.24.0-4ubun all          GTK+ bindings: devel files

我正在使用 Ubuntu 16.04 LTS,安装了 python 2&3。

谢谢

答案1

我必须从 /var/lib/dpkg/info 中删除所有包文件,然后运行

sudo dpkg --remove --force-remove-reinstreq python-gtk2-dev

如下所述https://stackoverflow.com/questions/48431372/removing-broken-packages-in-ubuntu

相关内容