我注意到我的包管理器没有更新,并一直给出关于第三方仓库的错误,所以我禁用了它们并尝试运行
sudo apt-get update && sudo apt-get install -f && sudo apt-get update
但是 hplip 包似乎不允许我这样做。我从终端收到以下错误消息:
(Reading database ... 253351 files and directories currently installed.)
Preparing to replace hplip-data 3.13.9-1 (using .../hplip-data_3.13.9-1ubuntu0.1_all.deb) ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: warning: subprocess old pre-removal script returned error exit status 1
dpkg: trying script from the new package instead ...
File "/usr/bin/pyclean", line 63
except (IOError, OSError), e:
^
SyntaxError: invalid syntax
dpkg: error processing /var/cache/apt/archives/hplip-data_3.13.9-1ubuntu0.1_all.deb (--unpack):
subprocess new pre-removal script returned error exit status 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 while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
/var/cache/apt/archives/hplip-data_3.13.9-1ubuntu0.1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我尝试从 /var/cache/apt 中删除 .deb 包,但仍然出现相同的错误。有什么想法吗?
答案1
我已将系统上的 pyclean 更改为 py3clean。这解决了问题。