尝试从 18.04 升级到 20.04,“您的 python3 安装已损坏”

尝试从 18.04 升级到 20.04,“您的 python3 安装已损坏”

关于:“你的python3安装已损坏

当我尝试将 18.04 LTS 更新到 20.04 LTS 时,所有链接的解决方案都对我不起作用:

$ uname -a
Linux Wormwood 5.4.0-42-generic #46~18.04.1-Ubuntu SMP Fri Jul 10 07:21:24 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
$ python --version
Python 2.7.17
$ python2 --version
Python 2.7.17
$ python3 --version
Python 3.6.9
$ update-alternatives --display python
update-alternatives: error: no alternatives for python
$ update-alternatives --display python2
update-alternatives: error: no alternatives for python2
$ update-alternatives --display python3
python3 - manual mode
  link best version is /usr/bin/python3.8
  link currently points to /usr/bin/python3.6
  link python3 is /usr/bin/python3
/usr/bin/python3.6 - priority 1
/usr/bin/python3.7 - priority 2
/usr/bin/python3.8 - priority 3
$ ls -l `which python`
lrwxrwxrwx 1 root root 18 Aug 11 21:12 /usr/bin/python -> /usr/bin/python2.7
$ ls -l /usr/bin/python2.7
-rwxr-xr-x 1 root root 3665768 Jul 20 08:37 /usr/bin/python2.7
$ ls -la /usr/bin/python2.7
-rwxr-xr-x 1 root root 3665768 Jul 20 08:37 /usr/bin/python2.7
$ python2.7 --version
Python 2.7.17
ls -l `which python2`
lrwxrwxrwx 1 root root 9 Aug  6  2019 /usr/bin/python2 -> python2.7
$ ls -l `which python3`
lrwxrwxrwx 1 root root 25 Aug  9 21:38 /usr/bin/python3 -> /etc/alternatives/python3
$ ls -l /etc/alternatives/python3
lrwxrwxrwx 1 root root 18 Aug 10 21:53 /etc/alternatives/python3 -> /usr/bin/python3.6
$ ls -l /usr/bin/python3.6
-rwxr-xr-x 2 root root 4526456 Jul 17 05:50 /usr/bin/python3.6
$ python3.6 --version
Python 3.6.9
$ sudo do-release-upgrade
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                         
Get:2 Upgrade tool [1,348 kB]                                                  
Fetched 1,350 kB in 0s (0 B/s)                                                 
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
extracting 'focal.tar.gz'

Reading cache

Checking package manager

Can not upgrade 

Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.

我没有发现 python[3] 存在问题。有什么建议吗?

答案1

这对我有用:

sudo ln -fs /usr/bin/python3.6 /usr/bin/python3

正如用户 Christian 在您的 python3 安装已损坏。请修复“/usr/bin/python3”符号链接

相关内容