Skip to content

Instantly share code, notes, and snippets.

@sbatururimi
Last active August 7, 2021 05:12
Show Gist options
  • Save sbatururimi/1dce7bb9564d32e0b40c7b5f95fa5a1f to your computer and use it in GitHub Desktop.
Save sbatururimi/1dce7bb9564d32e0b40c7b5f95fa5a1f to your computer and use it in GitHub Desktop.
Ubuntu Python3 removal/installation

Remove

sudo dpkg  --force-depends --purge  libpython3.9-minimal

Or

sudo dpkg --remove --force-depends python3.6 python3.6-minimal libpython3.6-minimal libpython3.6-stdlib

https://askubuntu.com/a/1069440

Что установлено

dpkg -l|grep python
ls /usr/bin/ | grep python

Remove the python

sudo apt-get purge --auto-remove python
sudo apt-get purge python3.6
$ sudo apt-get remove --auto-remove python3.6

Install

https://linuxize.com/post/how-to-install-python-3-9-on-ubuntu-20-04/

sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.9

Create symlinks(if wanted)

sudo ln -s /usr/bin/python3.9 /usr/bin/python3
sudo ln -s /usr/bin/python3 /usr/bin/python

Alternatively create symlinks with

update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.9 1
update-alternatives --install /usr/bin/python python /usr/bin/python3 1

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