這是 apt update / apt Upgrade / apt dist-upgrade 的結(jié)果sudo apt dist-upgradeReading package lists... DoneBuilding dependency tree Reading state information... DoneCalculating upgrade... DoneThe following packages will be upgraded: python-cryptography1 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] yReading 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 syntaxdpkg: warning: subprocess old pre-removal script returned error exit status 1dpkg: trying script from the new package instead ... File "/usr/bin/pyclean", line 63 except (IOError, OSError), e: ^SyntaxError: invalid syntaxdpkg: 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 1Traceback (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 SafeConfigParserImportError: No module named 'ConfigParser'dpkg: error while cleaning up: subprocess installed post-installation script returned error exit status 1Errors were encountered while processing: /var/cache/apt/archives/python-cryptography_1.7.1-3+deb9u2_amd64.debE: Sub-process /usr/bin/dpkg returned an error code (1)我不太確定我在這里到底做了什么,但我無法擺脫它。我似乎無法刪除該軟件包,或修復(fù)它,或重新安裝它,一切都會因該錯誤或類似錯誤而失敗。有人可以幫我擺脫這個該死的東西嗎?我已經(jīng)嘗試了幾天了。謝謝?。?!
2 回答

慕容森
TA貢獻(xiàn)1853條經(jīng)驗 獲得超18個贊
謝謝湯姆,雖然這不完全是我的問題,但它確實引導(dǎo)我走上了正確的道路?;旧?,這整個問題是因為我在某個時候?qū)?Python 3.5 設(shè)置為默認(rèn)值而引起的,顯然 Debian 出于某種原因無法找到處理該問題的方法。當(dāng)我恢復(fù)到2.7后,一切都很好。

MM們
TA貢獻(xiàn)1886條經(jīng)驗 獲得超2個贊
我今天也遇到了這個問題,python-cryptography 以類似的方式阻止了我。
我在 python-cryptography 包上手動運行 pyclean 。我是 root,所以你可能需要在命令前面加上 sudo
/usr/bin/pyclean python-cryptography
這讓我遇到了一組不同的錯誤(很可能與您的問題無關(guān)。我的系統(tǒng)非常損壞),但 dpkg 很高興再次開始工作。試一試
-湯姆
添加回答
舉報
0/150
提交
取消