'Upgrade Ubuntu: python3 install is corrupted

I'm trying to upgrade Ubuntu from version 18 to version 20 using sudo do-release-update, however it complains about my Python being corrupted: Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.

I know I messed with Python a few months ago to make a buggy project work on my machine, but now I have no idea how to fix this. I tried uninstalling and reinstalling Python with apt but it doesn't solve my problem. I also tried unalias python without success.

How do I fix this?



Solution 1:[1]

Try this:

sudo apt-get install --reinstall python3

The problem may be that Ubuntu 20 uses diffirent default python3 version than Ubuntu 18.

Solution 2:[2]

default that came with ubuntu 18.04 was python3.6

sudo rm /usr/bin/python3

create symlink

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

and then perform the upgrade

do-release-upgrade

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 ShlomiRex
Solution 2 Ramesh Ponnusamy