我想将我的 Ubuntu 18.04 升级到 20.04。当我尝试这样做时,出现以下错误:
Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.
我一直在寻找解决方案,发现可以通过以下方法解决:
sudo rm /usr/bin/python3 && sudo ln -s /usr/bin/python3.8 /usr/bin/python3
do-release-upgrade
但当我这样做时,我得到了:
bash: /usr/bin/do-release-upgrade: /usr/bin/python3: bad interpreter: No such file or directory
的输出type -a python3; file /usr/bin/python3
为:
bash: type: python3: not found /usr/bin/python3: broken symbolic link to /usr/bin/python3.8
输出为file /usr/bin/python3.6
:
/usr/bin/python3.6: cannot open `/usr/bin/python3.6' (No such file or directory)
我应该怎么办?
答案1
打开终端并输入:
sudo apt-get install --reinstall python3-all
sudo apt purge python3.8
sudo apt-get install --reinstall update-manager
sudo apt update
答案2
用户 Christian 评论道您的 python3 安装已损坏。请修复“/usr/bin/python3”符号链接需要/usr/bin/python3
指向/usr/bin/python3.6
。您需要的命令是:
sudo ln -fs /usr/bin/python3.6 /usr/bin/python3