The server I use now is centos release 5.4 (final), but python is still 2.4.3, which is relatively low. I always want to update it. The last time python was forcibly uninstalled, yum and some basic commands could not be used. Therefore, do not uninstall the old version. The new and old versions can coexist.
I found some materials in several foreign forums and executed the following command to install Python 2.6:
$ Rpm-uvh restart -- import/etc/pki/rpm-GPG/RPM-GPG-KEY-CHL $ rpm-uvh restart install libffi $ Yum install python26
The result is as follows:
$ Python26python 2.6.2 (r262: 71600, Sep 8 2009, 13:06:43) [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2type "help", "Copyright ", "Credits" or "License" for more information. >>>
This also encountered an error:
Python26-2.6.2-2.i386 from chlorophyll has depsolving problems --> missing dependency: libffi. so.5 is needed by package python26-2.6.2-2.i386 (chlorophyll) error: Missing dependency: libffi. so.5 is needed by package python26-2.6.2-2.i386 (chlorophyll)
This is because no installationProgramAfter you run the 3rd and 4th-line commands to install libffi, the problem is solved.
Independent blog links: http://lloydsheng.com/2010/05/how-to-update-python-in-centos.html