Skip to content

Instantly share code, notes, and snippets.

@n8henrie
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save n8henrie/dfde0e7f9e0802612251 to your computer and use it in GitHub Desktop.
Save n8henrie/dfde0e7f9e0802612251 to your computer and use it in GitHub Desktop.
Bash script to download source and configure / make the lastest Python3 on my Raspberry Pi.
#! /bin/bash -e
# Bash script to download source and configure / make the lastest Python3 on my Raspberry Pi.
LINKS='https://www.python.org/ftp/python/'
LATEST=$(curl -s https://www.python.org/ftp/python/ | ack '<a href="([\d\.]+)/">' --output "\$1" | sort -n | tail -n 1)
DL_URL='https://www.python.org/ftp/python/'$LATEST'/Python-'$LATEST'.tar.xz'
cd /var/tmp
wget -q $DL_URL
echo "Done downloading latest Python3."
tar -xf "Python-$LATEST.tar.xz"
echo "Done extracting into /var/tmp."
cd "Python-$LATEST"
./configure --prefix="/opt/python$LATEST"
echo "Done configuring. Starting make at $(date). This will take a while."
make
echo "Done with make."
echo "Now just waiting for you to cd to /var/tmp/Python-$LATEST and sudo make install"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment