CentOS 6.3自帶的Python版本爲2.6,首先須要升級到2.7版本。因爲舊版本的Python已被深度依賴,因此不能卸載原有的Python,只能全新安裝。python
1.下載Python-2.7.4.tgzpython2.7
wget http://python.org/ftp/python/2.7.4/Python-2.7.4.tgzide
1 tar -xvf Python-2.7.4.tgz
2 cd Python-2.7.4
3 ./configure --prefix=/usr/local/python2.7
4 make
5 make installget
1 mv /usr/bin/python /usr/bin/python.old
2 ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/pythonit
python –Vclass
問題:可能yum沒法使用,由於yum是基於python的
解決:先看python的路徑:whereis python 記住第二個路徑
再看which yum 到yum文件下修改解釋器爲 剛纔記住的路徑ftp