昨天我在摆弄我的电脑,没有意识到 /usr/bin/ 的重要性,就立即从那里删除了所有的 python 文件,然后出于某种原因继续删除所有依赖它们的软件包。
聪明,我知道。
今天经过几个小时,我设法恢复了几乎所有东西,但是,唯一不变的是 python3。每当我尝试重新安装时,我都会收到以下消息:
Preparing to unpack .../python3_3.4.0-0ubuntu2_amd64.deb ...
/var/lib/dpkg/info/python3.prerm: 5: /var/lib/dpkg/info/python3.prerm: py3clean: not found
dpkg: warning: subprocess old pre-removal script returned error exit status 127
dpkg: trying script from the new package instead ...
/var/lib/dpkg/tmp.ci/prerm: 5: /var/lib/dpkg/tmp.ci/prerm: py3clean: not found
dpkg: error processing archive /var/cache/apt/archives/python3_3.4.0-0ubuntu2_amd64.deb (--unpack):
subprocess new pre-removal script returned error exit status 127
/var/lib/dpkg/info/python3.postinst: 47: /var/lib/dpkg/info/python3.postinst: py3compile: not found
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 127
Errors were encountered while processing:
/var/cache/apt/archives/python3_3.4.0-0ubuntu2_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
py3clean
并且py3compile
应该在 中python3-minimal
。请先尝试安装它:sudo apt-get install python3-minimal
如果发现任何错误,请更新问题。