How to install Python 3.7 on Raspberry Pi

This short guide explains how to install Python version 3.7.0 on a Raspberry Pi running Raspbian aswell as other Debian based Linux distributions including Ubuntu.

First install the dependencies needed to build

sudo apt-get update
sudo apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev

Compile (takes a while!)
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz
tar xf Python-3.7.0.tar.xz
cd Python-3.7.0
./configure --prefix=/usr/local/opt/python-3.7.0
make -j 4

Install
sudo make altinstall

Make Python 3.7 the default version, make aliases
sudo ln -s /usr/local/opt/python-3.7.0/bin/pydoc3.7 /usr/bin/pydoc3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7 /usr/bin/python3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/python3.7m /usr/bin/python3.7m
sudo ln -s /usr/local/opt/python-3.7.0/bin/pyvenv-3.7 /usr/bin/pyvenv-3.7
sudo ln -s /usr/local/opt/python-3.7.0/bin/pip3.7 /usr/bin/pip3.7
alias python='/usr/bin/python3.7'
alias python3='/usr/bin/python3.7'
ls /usr/bin/python*
cd ..
sudo rm -r Python-3.7.0
rm Python-3.7.0.tar.xz
. ~/.bashrc

And verify:
python -V

And if you want to revert:
update-alternatives --config python

Ubuntu Linux kernel 4.17 installation guide

This installation guide describes how to install Linux Kernel 4.17 on Ubuntu Linux. This works with the latest version of Ubuntu Linux and most Ubuntu-based distributions including Kubuntu and Mint.

The included kernel files have been compiled using the generic Ubuntu configuration. A low latency version is also available in the directory of the linked files.

This post is an update of “Ubuntu Linux kernel 4.16 installation guide

The files can be found at  kernel.ubuntu.com/~kernel-ppa/mainline/v4.17/

Installation Guide (GUI)

TPM firmware upgrade

Windows 1803 reports outdated TPM firmware versions, including on the TPM 2 module I had from Asus (TPM-M R2.0) (containing the Infinite 9665 chipset).
This get rid of the error/warning you have to upgrade the firmware of the TPM chip. This is quite difficult and requires some fiddling.
The security warning is defined as ADV170012 | Vulnerability in TPM could allow Security Feature Bypass

cd Firmware
TPMFactoryUpd.exe -update config-file -config TPM20_latest.cfg
pause

  • Reboot the system
  • Open the bios and enable TPM
  • Reset the TPM  key
  • Reboot
  • Start Windows

Ubuntu Linux kernel 4.16 installation guide

This installation guide describes how to install Linux Kernel 4.16 on Ubuntu Linux. This works with the latest version of Ubuntu Linux and most Ubuntu-based distributions including Kubuntu and Mint.

The included kernel files have been compiled using the generic Ubuntu configuration. A low latency version is also available in the directory of the linked files.

This post is an update of “Ubuntu Linux kernel 4.15 installation guide

The files can be found at kernel.ubuntu.com/~kernel-ppa/mainline/v4.16/

Installation Guide (GUI)