If you are installing a new virtual machine, or install a Linux system. Need to install GCC, etc.
Yum-y install gcc gcc-c++ autoconf automake cmake ntp rsync ssh vim
Yum-y install zlib zlib-devel OpenSSL openssl-devel pcre-devel
1. Download Python-2.7.11. tgz2, unzip the file tar-ZXVF Python-2.7.11. tgz3, creating the installation directory mkdir/usr/local/python274, install Python./configure--prefix=/usr/local/Python27makemake Install5, modify the original Python version to point to MV/usr/bin/python/usr/bin/python2.6.6LN-s/usr/local/python27/bin/python/usr/bin/python
6. Command line inject python
[[email protected] software]# python
Python 2.7.11 (default, OCT 9 2016, 00:59:54)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-17)] on linux2
Type "Help", "copyright", "credits" or "license" for more information.
Installation Successful
7, after installation will affect the use of Yum
YumThe call is/usr/bin/python this file. So the change will be an error.
at this point we just need to modify the Yum configuration file and change the Python version to the previous version.
#vi/usr/bin/yum
Because my old version is 2.6, so change the #!/usr/bin/python to #!/usr/bin/python2.6 on it!
Exit Save
Command line Input Yum
Run Yum Normal
Linux installation python2.7