1. view the current Python version [plain] viewplaincopy # python-VPython2.6.6
1. view the current Python version
[Plain]View plain copy
- # Python-V
- Python 2.6.6
2. download Python2.7.5 source code
[Html]View plain copy
- # Wget http://python.org/ftp/python/2.7.5/Python-2.7.5.tgz
3. decompress the source code package
[Html]View plain copy
- # Tar xvf Python-2.7.5.tgz
4. go to the extract directory and install
[Html]View plain copy
- # Cd Python-2.7.5
- #./Configure
- # Make all
- # Make install
- # Make clean
- # Make distclean
5. set the default python to python2.7.5.
[Plain]View plain copy
- # Rm/usr/bin/python
- # Ln-s/usr/local/bin/python2.7/usr/bin/python
6. check the Python version.
[Plain]View plain copy
- # Python-V
- Python 2.7.5
7. solve the problem that yum cannot run.
Because yum runs on python2.6.6, you need to make some modifications to yum.
[Plain]View plain copy
- # Vim/usr/bin/yum
Set the #! of the first line #! /Usr/bin/python #! /Usr/bin/python2.6