9

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.

ezvine
  • 751
  • 1
  • 8
  • 23

1 Answers1

14

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

ezvine
  • 751
  • 1
  • 8
  • 23
  • 1
    Please [avoid link only answers](http://meta.stackoverflow.com/tags/link-only-answers/info). Answers that are "barely more than a link to an external site” [may be deleted](http://stackoverflow.com/help/deleted-answers). – Quentin Dec 17 '21 at 15:12
  • there were no direct answers for this on web. I struggled to find an answer for this. Thought this might help others. Anyway i'll add the steps from the link as well – ezvine Dec 17 '21 at 16:13
  • 2
    I got a segmentation fault when running this (something related to ensurepip). This answer helped me https://askubuntu.com/a/1377190 – luksfarris Mar 02 '22 at 10:30