Sunday, January 10, 2010

CentOS 5, Python 2.5 and a first post

So everyone is doing it and so am I. Can't have street cred these days unless you have a blog, Facebook, iPhone app and a Twitter account. So my first one is on CentOS 5.4 and Python 2.4, yeah, also know as RedHat Enterprise Museum. The nice thing about running a proven package such as CentOS is that hardly ever something breaks and then I have more time to drink beer. But, today I ran into a problem of actually needing Python 2.5 and I dared the source install (note: I am good at this but see above reason why I like proven packages). So, without further ranting:
tar -xzvf
cd Python2-5
make altinstall (important to have 2.4 and 2.5 run side by side)
cd /usr/bin
mv python python_org
ln -s /usr/local/bin/python2.5 python

At this point I knowingly broke yum since it has a dependency on 2.4. So,
cd /usr/bin
mv yum yum_org
vi yum
and add this to top:
#!/usr/bin/python2.4 instead of #!/usr/bin/python

Then install setuptools for Python2.5 and you're done. When installing packages simply call easy_install-2.5 or relink easy_install.

This is not recommended unless you really know the consequences and how to deal with them. Most Linux distribution rely heavily on Python for several utilities so if they originally shipped with 2.4 there is probably a good reason for it. Most of my main utilities are build from proven scripts so I am not going to loose sleep over this one and for now the engine rolls on.