First, view system Information
cat /etc/redhat-6.4uname -R2.6. -358. el6.x86_64
Ii. viewing the version of Python that has been installed
[Email protected] ~]# rpm-qa|grepPythonpython-2.6.6- $. EL6.X86_64LIBXML2-python-2.7.6-8. El6_3.4. X86_64python-urlgrabber-3.9.1-8. El6.noarchpython-iwlib-0.1-1.2. El6.x86_64python-libs-2.6.6- $. el6.x86_64rpm-python-4.8.0- +. El6.x86_64dbus-python-0.83.0-6.1. El6.x86_64python-iniparse-0.3.1-2.1. El6.noarchpython-pycurl-7.19.0-8. El6.x86_64libproxy-python-0.3.0-3. El6_3.x86_64libreport-python-2.0.9- the. EL6.CENTOS.X86_64NEWT-python-0.52. One-3. El6.x86_64python-ethtool-0.6-3. EL6.X86_64ABRT-addon-python-2.0.8- the. El6.centos.x86_64[[email protected]~]# Python-Vpython2.6.6
Third, download compile and install python2.7.5 version source package
[Email protected] ~]# cd/usr/local/Src[[email protected]~]#wgetHttps//www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz[Email protected] ~]#TarXVF python-2.7.5. Tgz[[email protected]~]# CD python-2.7.5[[Email protected]~]# ./Configure[[email protected]~]# MakeAll[[email protected]~]# Make Install[[Email protected]~]# MakeClean[[email protected]~]# MakeDistclean
Iv. set the system default Python version to 2.7.5
rm /usr/bin/ln -s/usr/local/bin/python2. 7 /usr/bin/python
V. Check the updated Python version
[email protected] ~]# python-2.7. 5
(EXT) 54612982
Liunx system upgrade comes with a Python version