Skip to content

Instantly share code, notes, and snippets.

@bewithdhanu
Last active April 7, 2025 07:41
Show Gist options
  • Save bewithdhanu/0df8d6c71f149c45ac42fd1735f32518 to your computer and use it in GitHub Desktop.
Save bewithdhanu/0df8d6c71f149c45ac42fd1735f32518 to your computer and use it in GitHub Desktop.
Upgrade Python 3.10 to 3.11 on Ubuntu 22.04

Check python version use python and python3

The first comman will Not show version info.

The second one show 3.10 as version as it is provided by ubuntu as default

python --version
python3 --version

Add additional repository to download python 3.11

sudo add-apt-repository ppa:deadsnakes/ppa

This might take more than few minutes

sudo apt update
sudo apt upgrade

Install python 3.11

sudo apt-get install python3.11

python3 shows 3.10 and python3.11 shows 3.11 as version

python3 --version
python3.11 --version
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1
sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.11 2

sudo update-alternatives --config python3

choose 2 for python 3.11

3.11 will be shown as version

python3 --version
sudo apt install python-is-python3
pip install --upgrade pip setuptools

3.11 will be shown as version

python --version
@credo1983
Copy link

thanks!

@jonescarvalho
Copy link

thanks for great tutorial

@rb58853
Copy link

rb58853 commented Mar 20, 2025

This broke my system

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