我有 Ubuntu 16.04。最近我将 Python 从 3.5 升级到了 3.8。现在,每当我尝试使用 apt 安装某些东西时,都会出现以下错误:
Setting up python3.5 (3.5.2-2ubuntu0~16.04.9) ...
/var/lib/dpkg/info/python3.5.postinst: 9: /var/lib/dpkg/info/python3.5.postinst: /usr/bin/python3.5: not found
dpkg: error processing package python3.5 (--configure):
subprocess installed post-installation script returned error exit status 127
dpkg: dependency problems prevent configuration of python3:
python3 depends on python3.5 (>= 3.5.1-2~); however:
Package python3.5 is not configured yet.
...
有没有办法告诉 dpkg 使用 Python 3.8 而不是 3.5?
编辑:我尝试使用 dpkg 重新安装 python3.5 但是失败了:
# sudo dpkg -i python3.5_3.5.2-2ubuntu0~16.04.9_amd64.deb
(Reading database ... 342998 files and directories currently installed.)
Preparing to unpack python3.5_3.5.2-2ubuntu0~16.04.9_amd64.deb ...
Unpacking python3.5 (3.5.2-2ubuntu0~16.04.9) over (3.5.2-2ubuntu0~16.04.9) ...
Setting up python3.5 (3.5.2-2ubuntu0~16.04.9) ...
/var/lib/dpkg/info/python3.5.postinst: 9: /var/lib/dpkg/info/python3.5.postinst: /usr/bin/python3.5: not found
dpkg: error processing package python3.5 (--install):
subprocess installed post-installation script returned error exit status 127
Processing triggers for bamfdaemon (0.5.3~bzr0+16.04.20180209-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Processing triggers for desktop-file-utils (0.22-1ubuntu5.2) ...
Processing triggers for mime-support (3.59ubuntu1) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
python3.5