How to undo "yum remove python"

Solution 1:

Pick a mirror from the list of CentOS 6 mirrors and install the packages you need using rpm. You would need to deal with dependencies. Lucky for you, I have a pretty bare VM with CentOS 6 x86_64 installed.

I snapshot the VM, ran yum remove python and had some fun getting through some circular dependencies. Final result:

# --nodeps: because of circular dependency between python and python-libs
rpm -i --nodeps http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/python-libs-2.6.5-3.el6.x86_64.rpm
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/python-2.6.5-3.el6.x86_64.rpm
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/pygpgme-0.1-18.20090824bzr68.el6.x86_64.rpm
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/python-pycurl-7.19.0-5.el6.x86_64.rpm 
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/python-urlgrabber-3.9.1-7.el6.noarch.rpm 
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/rpm-python-4.8.0-12.el6.x86_64.rpm 
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/yum-metadata-parser-1.1.2-14.1.el6.x86_64.rpm
# --nodeps: because of circular dependency between yum and yum-plugin-fastestmirror
rpm -i --nodeps http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.26-11.el6.noarch.rpm
rpm -i http://centos.mirrors.hoobly.com/6.0/os/x86_64/Packages/yum-3.2.27-14.el6.centos.noarch.rpm

Replace the mirror which whatever one you want. Also, make sure the architecture matches. That should do the trick though!

Oh one more thing: If I were you, I'd run a yum upgrade right after you're done installing the RPMs.