问题描述
这是apt更新/ apt升级/ apt dist-upgrade的结果
sudo apt dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
python-cryptography
1 upgraded,0 newly installed,0 to remove and 0 not upgraded.
24 not fully installed or removed.
Need to get 0 B/212 kB of archives.
After this operation,0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Reading changelogs... Done
(Reading database ... 81174 files and directories currently installed.)
Preparing to unpack .../python-cryptography_1.7.1-3+deb9u2_amd64.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",e:
^
SyntaxError: invalid Syntax
dpkg: error processing archive /var/cache/apt/archives/python-cryptography_1.7.1-3+deb9u2_amd64.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/python-cryptography_1.7.1-3+deb9u2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不确定我在这里实际上做了什么,但是我无法超越。我似乎无法删除,修复或重新安装该软件包,但一切都因该错误或类似错误而失败。有人可以帮我摆脱这该死的东西吗,我已经尝试了几天了。
谢谢!
解决方法
我今天也遇到了这个问题,python-cryptography也以类似的方式阻止了我。
我在python-cryptography软件包上手动运行pyclean。我是root用户,因此您可能需要在命令前添加sudo
<table id="main-table">
<tr>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
</tr>
<tr>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
<td contenteditable="true">Hey</td>
</tr>
</table>
<button id="delBtn">Delete Mode</button>
这使我遇到了一系列不同的错误(很可能与您的问题无关。我的系统非常损坏),但是dpkg很高兴可以再次开始工作。试一试
-汤姆
,感谢汤姆,虽然这不是我的问题,但确实使我走了正确的道路。基本上,整个问题是由于某个时候将Python 3.5设置为默认值而引起的,并且显然Debian出于某种原因都找不到解决该问题的方法。当我恢复到2.7时,一切都很好。