アップグレードCentOS 6.5はpython 2.6からPythoon 2.7.4まで持っています。

921 ワード

(1)python for linuxインストールパッケージをダウンロードする
0> wget http://python.org/ftp/python/2.7.4/Python-2.7.4.tgz --no-check-certificate
(2)インストールディレクトリの作成
0> cd /usr/local/lnmp
0> mkdir python
(3)インストールパッケージを解凍し、指定されたディレクトリにコンパイルする
0> tar zxvf Python-2.7.4.tgz  
0> cd Python-2.7.4
0> ./configure --prefix=/usr/local/lnmp/python
0> make && make install
(4)従来の/usr/bin/pythonの名称を変更し、ソフト接続とする。
0> whereis python
0> mv /usr/bin/python /usr/bin/python2.6.6
0> tail -n 2 /etc/profile            #/etc/profile         
PATH=$PATH:/usr/local/lnmp/python/bin
export PATH
0> source /etc/profile
0> ln -s /usr/local/lnmp/python/bin/python /usr/bin/python
0> python -V
Python 2.7.4
(5)vimプロファイルの変更 pythonを指定するのはシステムの元々持っていたバージョンです。2.6.6
0> vim /usr/bin/yum
#!/usr/bin/python2.6.6
-EOF-