Updating Python RHEL6

From Linux User Group at WUR
Jump to: navigation, search

On RedHat Enterprise Linux 6.x the "default Python version is 2.6.X. Due to the fact that the RHEL package manager (YUM) is dependend on that version , it is not possible to update this version.

However! There is an easy and save way to install Python 2.7 (and/or 3.3 )without "breaking" YUM.

By using the RedHat Software Collections, which installs rpms and the supporting libraries in /opt, you can use a "higher" Python version.

How to install this with a repository

First, install the Software Collection tools:

sudo yum install scl-utils

Now install a yum repo for Python .27 scl ( short for " Software Collection":

sudo sh -c 'wget -qO- http://people.redhat.com/bkabrda/scl_python27.repo >> /etc/yum.repos.d/scl.repo'

For Python 3.3 replace scl_python27 with scl_python33.repo

now you can install python 2.7:

sudo yum install python27

now we going to use the "Software Collection":

scl -l

Now it is possible to enable python 2.7 in your (bash) shell:

 scl enable python27 bash 
 python -V 
 Python 2.7.x