Created
August 26, 2025 20:15
-
-
Save henriquetorquato/7966fbd4f25e67c4d820c7dcef2196f5 to your computer and use it in GitHub Desktop.
Automation to install Python2, which is no longer available on some official Linux distribution repositories
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 | |
if [[ $(/usr/bin/id -u) -ne 0 ]]; then | |
echo "Required to run as root" | |
exit | |
fi | |
# Setup | |
mkdir /tmp/python2-install | |
cd /tmp/python2-install | |
# Download & Extraction | |
wget https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz | |
tar -xvzf /tmp/python2-install/Python-2.7.13.tgz | |
chmod -R 777 /tmp/python2-install/Python-2.7.13 | |
cd /tmp/python2-install/Python-2.7.13 | |
# Installation | |
./configure | |
make install | |
# Validation | |
python2 -V | |
# Cleanup | |
cd - | |
rm -r /tmp/python2-install |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
One-liner:
su -c "$(curl -fsSL https://gist.githubusercontent.com/henriquetorquato/7966fbd4f25e67c4d820c7dcef2196f5/raw/c6d7861f9db8d82f06b9ff9bb9ce069bd1279622/install-python2.sh)"