源码安装python2.7

[root@server /]# tar -zxf Python-2.7.11.tgz

[root@server /]# cd Python-2.7.11

[root@server /]# ./configure && make && make install

[root@server usr]# /usr/local/bin/python

Python 2.7.11 (default, Jan  2 2017, 12:16:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> exit()

[root@server usr]# python

Python 2.6.6 (r266:84292, Nov 22 2013, 12:16:22) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

>>> exit()

[root@server usr]# 

[root@server usr]# cd ..

[root@server /]# cp /usr/bin/python /usr/bin/python.bak.20170102

[root@server /]# 

[root@server /]# rm /usr/bin/python

rm: remove regular file `/usr/bin/python'? y

[root@server /]# 

[root@server /]# ln -s /usr/local/bin/python

python            python2.7         python2-config    

python2           python2.7-config  python-config     

[root@server /]# ln -s /usr/local/bin/python2.7 /usr/bin/python

[root@server /]# 

[root@server /]# python

Python 2.7.11 (default, Jan  2 2017, 12:16:39) 

[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2

Type "help", "copyright", "credits" or "license" for more information.

>>> 

>>> exit()


上一篇:我的博客即将入驻“云栖社区”,诚邀技术同仁一同入驻。


下一篇:C++11使用make_shared的优势和劣势