Install Python3.10 on Ubuntu 23.04

I’ve tried to install python3.10 alongside with native python3.11, on Ubuntu 23.04, but looks like it’s not available.

mika@system:~$ sudo apt update && sudo apt install python3.10
Hit:1 http://ru.archive.ubuntu.com/ubuntu lunar InRelease
Get:2 http://ru.archive.ubuntu.com/ubuntu lunar-updates InRelease [109 kB]
Hit:3 https://repo.yandex.ru/yandex-browser/deb stable InRelease          
Get:4 http://ru.archive.ubuntu.com/ubuntu lunar-backports InRelease [99.8 kB]
Get:5 http://security.ubuntu.com/ubuntu lunar-security InRelease [109 kB] 
Fetched 317 kB in 1s (295 kB/s)    
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
All packages are up to date.
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package python3.10 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3.10' has no installation candidate

I’ve tried to use deadsnakes, but they don’t have the Release file for current Ubuntu version. Executing sudo add-apt-repository ppa:deadsnakes/ppa confirms that.

Is it possible to install python3.10 on Ubuntu 23.04?

Asked By: MIku

||

One way to do this is to include the repos from an old version. This may include more packages than you would like, but I’ve found it works. Generally safe, doesn’t bother other things, and fairly benign.

sudo add-apt-repository -y -s deb http://security.ubuntu.com/ubuntu jammy main universe

Then your system will see older software options, including from jammy distro.

Answered By: N810

try this instead of deadsnakes:

sudo add-apt-repository ppa:savoury1/python
sudo apt update
sudo apt-get install python3.10
Answered By: Nahshon paz