Install python 3.10 on Ubuntu 20.04

Installing python 3.10 Ubuntu 20.04

Given the age of Ubuntu 20.04 vs Ubuntu 22.04, installing python3.10 in Ubuntu 20.04 requires reading from a PPA rather than the regular software packages. That means to upgrade python to 3.10 on Ubuntu 20.04 you'll need to add a community repository.

How to Add Package Python 3.10 to Ubuntu 20.04

Commands below will require sudo - but I'm not including it so that you don't copy and paste sudo commands!!!

apt install software-properties-common
software-properties-common will let us add a PPA
add-apt-repository ppa:deadsnakes/ppa
Add the deadsnakes PPA to your system's software repository list
apt-get update
Update the package index

How To Install Python 3.10 After Adding Package

apt-get install python3.10 python3.10-distutils python3-mysqldb python3.10-dev
Install python3.10

Word of Caution: you want to be careful when adding a PPA of developers you don't know. So why should you trust deadsnakes? Well, use at your own risk, but it's been run by Anthony Sottile and Felix Krull for years and is the most widely recommended way to install new versions of python.
https://askubuntu.com/questions/1398568/installing-python-who-is-deadsnakes-and-why-should-i-trust-them