![由于 Python 3 的符号链接损坏,无法升级到最新的 Ubuntu 版本](https://linux22.com/image/929376/%E7%94%B1%E4%BA%8E%20Python%203%20%E7%9A%84%E7%AC%A6%E5%8F%B7%E9%93%BE%E6%8E%A5%E6%8D%9F%E5%9D%8F%EF%BC%8C%E6%97%A0%E6%B3%95%E5%8D%87%E7%BA%A7%E5%88%B0%E6%9C%80%E6%96%B0%E7%9A%84%20Ubuntu%20%E7%89%88%E6%9C%AC.png)
我想将我的 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