Last active
November 11, 2025 20:49
-
-
Save guillaumesmo/aa9717da1747b63c4f6c32a5c7a45cf9 to your computer and use it in GitHub Desktop.
Install Python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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