Centos – Python update, broke yum and python

centospythonyum

Ok, I've really ballsed up a server and wondering if the easiest way from this point is to reinstall the OS and restore the files. (We have file backups, but not bootable server backups)

I stupidly followed this tutorial, without reading the whole thing: http://wiki.railsmachine.com/RpmforgeRepository

And the fix posted at the bottom didn't work. I tried to uninstall and reinstall python from source, and that appears to have made things worse. at the minute, the main errors I'm seeing are:

[root@ tmp]# yum instal asjkdhaskdh
-bash: /usr/bin/yum: /usr/bin/python: bad interpreter: No such file or directory

And when I tried to install from source, I was told I have no C compiler. Is there another way of reinstalling Python that I should try? I'm on CentOS.

Any help greatly appreciated!
Thanks guys.

Best Answer

Have you tried to install python using rpm? Just download RPM file from distribution for your architecture and issue something like

rpm -Uvh python-2.6.6-29.el6.i686.rpm