1

I would like to upgrade my Ubuntu to 20.04.3 LTS from 18.04.6 LTS but I have an error when running do-release-upgrade :

Cannot upgrade

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

I noticed that python point to my virtual environement even when it's not activated.

user@abc-lenovo-ideapad-710s-13isk$ which python
/home/user/python/env/bin/python

My question is how can I make python points to /usr/bin/python3.9 ?

This is what I have tried :

sudo update-alternatives  --set python /usr/bin/python3.9     
update-alternatives: error: alternative /usr/bin/python3.9 for python not registered; not setting

This command works with python3 but unfortunnatly it doesn't change and which python still points to the /home/bragar/python/env/bin/python

This is all the python binaries:

user@abc-lenovo-ideapad-710s-13isk:~$ ls /usr/bin/python*
/usr/bin/python     /usr/bin/python2.7-config  /usr/bin/python3.6         /usr/bin/python3.6m-config  /usr/bin/python3.9         /usr/bin/python3-jsonschema  /usr/bin/python-config
/usr/bin/python2    /usr/bin/python2-config    /usr/bin/python3.6-config  /usr/bin/python3.7          /usr/bin/python3.9-config  /usr/bin/python3m
/usr/bin/python2.7  /usr/bin/python3           /usr/bin/python3.6m        /usr/bin/python3.7m         /usr/bin/python3-config    /usr/bin/python3m-config
Manicore
  • 131

1 Answers1

1

You have to remove your local python from PATH environment variable and run upgrade process by using the following commands:

export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
sudo -E apt-get update
sudo -E apt-get dist-upgrade
sudo -E do-release-upgrade
N0rbert
  • 103,263