yum中最新的也是Python 2.6.6,只能下载Python 2.7.5的源代码自己编译安装。
操作步骤如下:
1)下载并解压Python 2.7.9的源代码
cd /opt wget --no-check-certificate https://www.python.org/ftp/python/2.7.9/Python-2.7.5.tar.xz tar xf Python-2.7.5.tar.xz cd Python-2.7.5
4)编译与安装Python 2.7.5
./configure --prefix=/usr/local/python make && make altinstall
5)将python命令指向Python 2.7.5
ln -s /usr/local/python/bin/python2.7 /usr/local/bin/python
6)检查Python版本
sh sh-4.1# python -V Python 2.7.5
库文件:
/usr/local/src/Python-2.7.5/Lib/ConfigParser.py