Skip to content

Instantly share code, notes, and snippets.

@Brant
Last active December 28, 2015 20:46
Show Gist options
  • Save Brant/9993559 to your computer and use it in GitHub Desktop.
Save Brant/9993559 to your computer and use it in GitHub Desktop.
Install Python2.7 on Redhat/CentOS
#!/bin/bash
# Install Python 2.7.8 alternatively
yum groupinstall "development tools" -y
yum install readline-devel openssl-devel gmp-devel ncurses-devel gdbm-devel zlib-devel expat-devel libGL-devel tk tix gcc-c++ libX11-devel glibc-devel bzip2 tar tcl-devel tk-devel pkgconfig tix-devel bzip2-devel sqlite-devel autoconf db4-devel libffi-devel valgrind-devel -y
mkdir tmp
cd tmp
wget http://python.org/ftp/python/2.7.9/Python-2.7.8.tgz
tar xvfz Python-2.7.9.tgz
cd Python-2.7.9
./configure --prefix=/usr/local --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
make && make altinstall
cd ..
cd ..
rm -rf tmp
@Brant
Copy link
Author

Brant commented Sep 3, 2014

updated for 2.7.8

@Brant
Copy link
Author

Brant commented Apr 17, 2015

updated for 2.7.9

@blakemcbride
Copy link

I think you have a small bug. You want to install 2.7.9 but you make one reference to 2.7.8 in:

wget http://python.org/ftp/python/2.7.9/Python-2.7.8.tgz

@blakemcbride
Copy link

I think libffi-devel is just libffi now.

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