Dev Notes

Software Development Resources by David Egan.

Build Python from Source in Linux

Linux, Python
David Egan

Get the latest version of Python on Ubuntu

Download the latest version of Python from here:

# Download Python:

# Download the detached signature file:

Verify Download

Checksums (MD5) are presented on the dowloads/releases/python-xxx/ page.

Check the md5sum manually by running:

md5sum Python-3.8.2.tgz

You can also automate the check by building a suitable manifest file and checking this:

# Get md5 checksum from website, filename corresponds to the download
cat > manifest
f9f3768f757e34b342dbc06b41cbc844  Python-3.8.2.tgz

# Ctrl-d to exit cat
md5sum -c checksum 2>&1 | grep OK 
# Output if correct:
Python-3.8.2.tgz: OK

The website also posts the filesize, so you should also check this.

Import Relevant GPG Key From Trusted Server

# Imports key sourced here:
gpg --keyserver --recv-keys B26995E310250568

Check that the downloaded file has been signed by this key:

# Reference the signature file
gpg --verify Python-3.8.2.tgz.asc
# Correct output:
gpg: assuming signed data in `Python-3.8.2.tgz'
gpg: Signature made Tue 25 Feb 2020 10:41:46 GMT using RSA key ID 10250568
gpg: Good signature from "Łukasz Langa (GPG <>"
gpg:                 aka "Łukasz Langa <>"
gpg:                 aka "Łukasz Langa (Work e-mail account) <>"
gpg:                 aka "[jpeg image of size 24479]"
gpg: WARNING: This key is not certified with a trusted signature!
gpg:          There is no indication that the signature belongs to the owner.
Primary key fingerprint: E3FF 2839 C048 B25C 084D  EBE9 B269 95E3 1025 0568


tar -xvf Python-3.8.2.tgz

This unpacks files into a directory (in this case, Python-3.8.2) which you should move into:

cd Python-3.8.2

Check out the README.rst.


./configure --enable-optimizations
make test
sudo make install

This will install Python as python3.

comments powered by Disqus