xxxxxxxxxx
do the following :
2027 sudo add-apt-repository ppa:deadsnakes/ppa
2028 apt-get update
2029 python3 -V
2030 apt-get update
2031 apt list | grep python3.10
2032 python3 -V
2033 sudo apt-get install python3.10
2034 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
2035 sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2
2036 sudo update-alternatives --config python3
2037 python3 -V
https://www.itsupportwale.com/blog/how-to-upgrade-to-python-3-10-on-ubuntu-18-04-and-20-04-lts/
xxxxxxxxxx
sudo apt install python3.10 #or whatever version you want
sudo update-alternatives --config python3 #select which version you want to use
More info on how here -> https://cloudbytes.dev/snippets/upgrade-python-to-latest-version-on-ubuntu-linux
xxxxxxxxxx
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt install python3.10