Centos 6.6 comes with Python 2.6.6 and is now upgraded to 2.7.6
[Email protected] ~]# python-v
Python 2.6.6
The procedure is as follows:
1) Download and unzip the Python 2.7.6 source package
[Email protected] ~]# cd/usr/local/src
[Email protected] ~]# wget http://python.org/ftp/python/2.7.6/Python-2.7.6.tgz
[Email protected] src]# TAR-ZXVF python-2.7.6.tgz
[Email protected] src]# CD Python-2.7.6
[Email protected] python-2.7.6]# ./configure–prefix=/usr/local/python27
[[email protected] python-2.7.6]# make
[[email protected] python-2.7.6]# make install
2) Backup/usr/bin/python
[Email protected] python-2.7.6]# mv/usr/bin/python/usr/bin/python_old
3) The new Python 2.7.6 soft chain to/usr/bin
[Email protected] python-2.7.6]# ln-s/usr/local/python27/bin/python/usr/bin/python
4) Check the existing Python version
[Email protected] python-2.7.6]# python-v
Python 2.7.6
5) Modify the/usr/bin/yum, otherwise Yum will not be able to use
[Email protected] python-2.7.6]# Vim/usr/bin/yum
#!/usr/bin/python modified to #!/usr/bin/python2.6
6) Modify/usr/bin/yum to verify
[[email protected] python-2.7.6]# yum-y install vim
This article is from the "Laura" blog, be sure to keep this source http://benet1006.blog.51cto.com/9473151/1715820
Linux Upgrade Python