python 2.6.6 upgrade to python version 2.7.x

  • 2020-05-12 02:49:49
  • OfStack

1. Download python2. 7. x

wget https://www.python.org/ftp/python/2.7.6/Python-2.7.6.tgz

2. Unzip and compile the installation

tar -zxvf Python-2.7.6.tgz && cd Python-2.7.6 && ./configure && make all && make install && make clean && make distclean

3. Check the installation

/usr/local/bin/python2.7 -V

4. Establish a soft connection and use the default python point

mv /usr/bin/python /usr/bin/python2.6.6

ln -s /usr/local/bin/python2.7 /usr/bin/python

5. Check the

python -V

6. Use yum with caution

After the system Python soft link points to Python2.7 version, yum cannot work properly because yum is not compatible with Python 2.7. We need to specify Python version of yum

vim /usr/bin/yum will header #! / usr/bin/python to #! / usr/bin/python2. 6.6 (just backup)


Related articles: