How Do You Troubleshoot “Your python3 install is corrupted. Please fix the ‘/usr/bin/python3’ symlink.”?

Problem scenario
You run this command:

sudo do-release-upgrade

But you see this error:

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

What should you do?

Run this command:

tail -n 20 /var/log/dist-upgrade/main.log

Do you see a message like this?

2022-03-18 19:36:59,240 DEBUG python symlink points to: 'python3.5', but expected is 'python2.7' or '/usr/bin/python2.7'

If so, temporarily backup your python3.5 or python3.* file. Make a note of the location of this backed up file. Next, run this command:

sudo find / -name python2.7

Copy that file into /usr/bin/.

sudo mv -i /usr/bin/python /usr/bin/bak.python.bak
sudo ln -s /usr/bin/python2.7 /usr/bin/python

That may fix the problem. Try the original operation again [with a Python 2.x version].

Leave a comment

Your email address will not be published. Required fields are marked *