How to install python 3.6 on Ubuntu 21.10?

Viewed 4852

Since python 3.6 is no longer supported in Ubuntu 21.10 and the usual deadsnakes method also doesnt work. It gives following error.

E: The repository 'http://ppa.launchpad.net/deadsnakes/ppa/ubuntu impish Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

1 Answers

There is no release available in Deadsnake repo.

I was able to install using by following the steps here: https://tecadmin.net/install-python-3-6-ubuntu-linuxmint/

Step 1 – Prerequsities

sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

libreadline-gplv2-dev failed for me, in that case remove that and install the rest.

Step 2 – Download Python 3.6

cd /usr/src
sudo wget https://www.python.org/ftp/python/3.6.10/Python-3.6.10.tgz

sudo tar xzf Python-3.6.10.tgz

Step 3 – Compile Python Source

cd Python-3.6.10
sudo ./configure --enable-optimizations
sudo make altinstall

make altinstall is used to prevent replacing the default python binary file /usr/bin/python.

Step 4 – Check the Python Version

python3.6 -V

Thats it. You have installed python3.6 on your machine.

In case you are not able to install from there. This might help: https://askubuntu.com/questions/866901/what-can-i-do-if-a-repository-ppa-does-not-have-a-release-file/1302382#1302382

Related