Skip to content

Instantly share code, notes, and snippets.

@cobaohieu
Last active June 11, 2025 05:45
Show Gist options
  • Select an option

  • Save cobaohieu/9654c9b05edd6bcfce1965e9f5cec195 to your computer and use it in GitHub Desktop.

Select an option

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

@vanduc95

Copy link
Copy Markdown

Nice 👍

@50-Course

Copy link
Copy Markdown

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
Copy Markdown

thanks! this worked perfectly...

@niyvan

niyvan commented Sep 16, 2023

Copy link
Copy Markdown

Thanks

@MapinguariJoulemeter

Copy link
Copy Markdown

Thanks!

@Mayurji

Mayurji commented Dec 30, 2023

Copy link
Copy Markdown

thank you.

@KiselevMaxim

Copy link
Copy Markdown

thank you!

@AlexanderStohr

AlexanderStohr commented Jan 26, 2024

Copy link
Copy Markdown

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
Copy Markdown

Thank you! You saved hours of my day.

@0xMarto

0xMarto commented Feb 21, 2024

Copy link
Copy Markdown

thx!!!

@dnintzeli

Copy link
Copy Markdown

Worked! Thank you!

@mgberg

mgberg commented Mar 14, 2024

Copy link
Copy Markdown

Very helpful!

@Zackhardtoname

Copy link
Copy Markdown

I used 3.5 for 16.04

@michaelgrafl

Copy link
Copy Markdown

Thanks!

@Zer0x00

Zer0x00 commented Feb 7, 2025

Copy link
Copy Markdown

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