Skip to content

Instantly share code, notes, and snippets.

@lsdr
Created August 8, 2012 12:45
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 lsdr/3294842 to your computer and use it in GitHub Desktop.
Save lsdr/3294842 to your computer and use it in GitHub Desktop.
alt-install python2.7 on a x86_64 centos6 box
#!/bin/bash
# Install Python 2.7.3 alternatively
# original script:
# https://github.com/bngsudheer/bangadmin/blob/master/linux/centos/6/x86_64/build-python-27.sh
#
yum groupinstall "development tools" -y
yum install -y 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
mkdir tmp
cd tmp
wget http://python.org/ftp/python/2.7.3/Python-2.7.3.tgz
tar xvfz Python-2.7.3.tgz
cd Python-2.7.3
./configure --prefix=/opt/python2.7 --enable-shared
make
make altinstall
echo "/opt/python2.7/lib" >> /etc/ld.so.conf.d/opt-python2.7.conf
ldconfig
cd ..
cd ..
rm -rf tmp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment