Skip to content

Instantly share code, notes, and snippets.

@sacreman
Created November 19, 2014 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sacreman/062b0402e90120790f55 to your computer and use it in GitHub Desktop.
Save sacreman/062b0402e90120790f55 to your computer and use it in GitHub Desktop.
Centos 6 upgrade to Python 2.7
#!/usr/bin/env bash
# install build tools
sudo yum install make automake gcc gcc-c++ kernel-devel git-core -y
# install python 2.7 and change default python symlink
sudo yum install python27-devel -y
sudo rm /usr/bin/python
sudo ln -s /usr/bin/python2.7 /usr/bin/python
# yum still needs 2.6, so write it in and backup script
sudo cp /usr/bin/yum /usr/bin/_yum_before_27
sudo sed -i s/python/python2.6/g /usr/bin/yum
sudo sed -i s/python2.6/python2.6/g /usr/bin/yum
# should display now 2.7.5 or later:
python -V
# now install pip for 2.7
sudo curl -o /tmp/ez_setup.py https://sources.rhodecode.com/setuptools/raw/bootstrap/ez_setup.py
sudo /usr/bin/python27 /tmp/ez_setup.py
sudo /usr/bin/easy_install-2.7 pip
@sacreman
Copy link
Author

You need a repo file in /etc/yum.repos.d with this inside..

[PUIAS_6_computational]
name=PUIAS Computational Base
mirrorlist=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch/mirrorlist

baseurl=http://puias.math.ias.edu/data/puias/computational/$releasever/$basearch

gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-puias

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