Skip to content

Instantly share code, notes, and snippets.

@dvorka
Created March 20, 2018 08:33
Show Gist options
  • Save dvorka/ee34c180d846d5fa8f0ecdd3a8338f7f to your computer and use it in GitHub Desktop.
Save dvorka/ee34c180d846d5fa8f0ecdd3a8338f7f to your computer and use it in GitHub Desktop.
upgrade Python 2.7.6 -> 2.7.9 on Ubuntu 14.04
#!/bin/sh
#
# Installs Python 2.7.9 on Ubuntu 14.04 to include security updates
# Run this script with superuser privileges.
#
BASEDEPS="build-essential python-pip"
BUILDDEPS="libbz2-dev \
libc6-dev \
libgdbm-dev \
libncursesw5-dev \
libreadline-gplv2-dev \
libsqlite3-dev \
libssl-dev \
tk-dev"
TARFILE="Python-2.7.9.tgz"
TARHOST="https://www.python.org/ftp/python/2.7.9"
SRCDIR="Python-2.7.9"
apt-get update
apt-get install -y $BASEDEPS $BUILDDEPS
if [ ! -e $SRCDIR ]; then
wget "$TARHOST/$TARFILE"
tar xvf $TARFILE
fi
cd $SRCDIR
./configure
make
make install
cd ..
python -m ensurepip --upgrade
echo "removing source files"
rm $TARFILE
rm -r $SRCDIR
@braselectron
Copy link

I am installing a package on a RPi running raspbian wheezy (which I cannot update or will break installation) and because of ssl patch need to upgrade python to 2.7.9+ but where do I get the build dep.: libreadline-gplv2-dev
libncursesw5-dev
libsqlite3-dev
tk-dev
libgdbm-dev
libbz2-dev
?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment