Note
All of this is now made far more convenient with uv
and -p/--python <PYTHON_VERSION>
. Just run uv <cmd> -p 3.10
and you’re done.
I use apt-get autoremove -y
in my upgrade
script, which made me feel the discomfort of seeing python3.10
uninstalled from my system without being able to install it again with apt
, as it’s no longer available in the Debian’s package list.
Fortunately, even if it’s not as straightforward as apt install python3.10
, it’s still possible to reinstall it from source.
Installation Steps
Update the Package List
Install the Required Build Dependencies
Download Python 3.10 Sources
PYTHON_VERSION=3.10.14
curl -LO https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz
Change the value of the variable to the version you want to install.
Extract the Tarball
Change Directory
Configure the Build Environment
Compile the Source Code
Install Python 3.10
Check the Installation
This installation won’t erase the python3
or python
symlink; you’ll have to execute python3.10
.