Skip to content

Instantly share code, notes, and snippets.

@cobaohieu
Last active February 7, 2025 16:06
Show Gist options
  • Save cobaohieu/9654c9b05edd6bcfce1965e9f5cec195 to your computer and use it in GitHub Desktop.
Save cobaohieu/9654c9b05edd6bcfce1965e9f5cec195 to your computer and use it in GitHub Desktop.
fix Your python3 install is corrupted. Please fix the '/usr/bin/python3' symlink.

sudo apt install --reinstall python3

sudo apt install --reinstall python

sudo update-alternatives --remove-all python

sudo update-alternatives --remove-all python3

sudo ln -sf /usr/bin/python2.7 /usr/bin/python

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

@50-Course
Copy link

HI I have this issue however, Am new to the entire concept, does your gist means reverting to Python 2.7? I want my default in 3.10 which I upgraded from 3.8 recently

@ruizbaier
Copy link

thanks! this worked perfectly...

@niyvan
Copy link

niyvan commented Sep 16, 2023

Thanks

@MapinguariJoulemeter
Copy link

Thanks!

@Mayurji
Copy link

Mayurji commented Dec 30, 2023

thank you.

@KiselevMaxim
Copy link

thank you!

@AlexanderStohr
Copy link

AlexanderStohr commented Jan 26, 2024

please note that some older Linux distributions were based upon python 2.x and you would corrupt the system if "python" was set to be a "python3" version. there were times where v2 was mandatory and v3 was optional. this meanwhile has sort of swapped.

beyond that i have not yet ever checked if alternatives selection will allow to have a per-system or per-user preference for a specific python major/minor version. instead there is lots of people going for per-project virtual environment tooling (venv, et.al.) in user space - or folks that use docker and similar runtime image setups - all is sort of a decoupling from the system's python and module setup.

@joaoroman23
Copy link

Thank you! You saved hours of my day.

@0xMarto
Copy link

0xMarto commented Feb 21, 2024

thx!!!

@dnintzeli
Copy link

Worked! Thank you!

@mgberg
Copy link

mgberg commented Mar 14, 2024

Very helpful!

@Zackhardtoname
Copy link

I used 3.5 for 16.04

@michaelgrafl
Copy link

Thanks!

@Zer0x00
Copy link

Zer0x00 commented Feb 7, 2025

It's 3.10 for 22.04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment