Skip to content

Instantly share code, notes, and snippets.

@guillaumesmo
Last active November 11, 2025 20:49
Show Gist options
  • Select an option

  • Save guillaumesmo/aa9717da1747b63c4f6c32a5c7a45cf9 to your computer and use it in GitHub Desktop.

Select an option

Save guillaumesmo/aa9717da1747b63c4f6c32a5c7a45cf9 to your computer and use it in GitHub Desktop.
Install Python
#!/bin/bash
for pkg in build-essential libssl-dev zlib1g-dev; do
if ! dpkg-query -W -f='${Status}' "$pkg" 2>/dev/null | grep -q "ok installed"; then
apt-get install -y "$pkg"
apt-mark auto "$pkg"
fi
done
cd /opt
wget https://www.python.org/ftp/python/3.8.20/Python-3.8.20.tgz
tar -xf Python-3.8.20.tgz
cd Python-3.8.20
./configure #--enable-optimizations
make -j$(nproc)
sudo make altinstall
/usr/local/bin/python3.8 --version
cd ..
rm -fr Python-3.8.20*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment