python --version
python3 --version
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
sudo apt upgrade
sudo apt-get install python3.11
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
python3 --version
sudo apt install python-is-python3
pip install --upgrade pip setuptools
python --version
Thank you, these steps were really helpful for me too.
But a word of caution for Ubuntu 22-04, (I'm not sure if it applies to new Ubuntu versions): changing the default python3 version breaks the terminal app. (See https://askubuntu.com/questions/1442350/terminal-not-launching-in-ubuntu-22-04 for a discussion)
To avoid that, make sure that the existing python3 version has the highest priority, e.g.