deadsnakes recently removed support for Ubuntu 20.04: https://github.com/deadsnakes/py3.11/commit/54c42edda82a91620e5c26b5e27eeda1527e2cff
So, currently, trying to install any version of python newer than 3.9 will result in an error.
user@b5c6a363ca19:~$ apt-cache search python3 | grep "^python3.[0-9]"
python3.8 - Interactive high-level object-oriented language (version 3.8)
python3.8-dbg - Debug Build of the Python Interpreter (version 3.8)
python3.8-dev - Header files and a static library for Python (v3.8)
python3.8-doc - Documentation for the high-level object-oriented language Python (v3.8)
python3.8-examples - Examples for the Python language (v3.8)
python3.8-minimal - Minimal subset of the Python language (version 3.8)
python3.8-venv - Interactive high-level object-oriented language (pyvenv binary, version 3.8)
python3.8-full - Python Interpreter with complete class library (version 3.8)
python3.9 - Interactive high-level object-oriented language (version 3.9)
python3.9-dbg - Debug Build of the Python Interpreter (version 3.9)
python3.9-dev - Header files and a static library for Python (v3.9)
python3.9-doc - Documentation for the high-level object-oriented language Python (v3.9)
python3.9-examples - Examples for the Python language (v3.9)
python3.9-full - Python Interpreter with complete class library (version 3.9)
python3.9-minimal - Minimal subset of the Python language (version 3.9)
python3.9-venv - Interactive high-level object-oriented language (pyvenv binary, version 3.9)
user@b5c6a363ca19:~$ sudo apt install python3.11
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package python3.11
E: Couldn't find any package by glob 'python3.11'
I know I can use Astral's uv to install multiple python versions, but I would like to have it as alternatives to the default system python and in PATH.
Any other easy way of installing newer python versions in Ubuntu 20.04? Like just run a command and install, not compile from source.