2021-05-12 14:32:11
CentOS 6.4系統升級自帶的Python版本
CentOS 6.4系統升級自帶的Python版本
一、檢視系統資訊
[root@localhost ~]# cat /etc/RedHat-release
CentOS release 6.4 (Final)
[root@localhost ~]# uname -r
2.6.32-358.el6.x86_64
二、檢視已安裝python版本
[root@localhost ~]# rpm -qa|grep python
python-2.6.6-36.el6.x86_64
libxml2-python-2.7.6-8.el6_3.4.x86_64
python-urlgrabber-3.9.1-8.el6.noarch
python-iwlib-0.1-1.2.el6.x86_64
python-libs-2.6.6-36.el6.x86_64
rpm-python-4.8.0-32.el6.x86_64
dbus-python-0.83.0-6.1.el6.x86_64
python-iniparse-0.3.1-2.1.el6.noarch
python-pycurl-7.19.0-8.el6.x86_64
libproxy-python-0.3.0-3.el6_3.x86_64
libreport-python-2.0.9-15.el6.centos.x86_64
newt-python-0.52.11-3.el6.x86_64
python-ethtool-0.6-3.el6.x86_64
abrt-addon-python-2.0.8-15.el6.centos.x86_64
[root@localhost ~]# python -V
Python 2.6.6
三、下載編譯安裝python2.7.5版本原始碼包
[root@localhost ~]# cd /usr/local/src
[root@localhost ~]# wget https://www.python.org/ftp/python/2.7.5/Python-2.7.5.tgz
[root@localhost ~]# tar xvf Python-2.7.5.tgz
[root@localhost ~]# cd Python-2.7.5
[root@localhost ~]# ./configure
[root@localhost ~]# make all
[root@localhost ~]# make install
[root@localhost ~]# make clean
[root@localhost ~]# make distclean
四、將系統預設的python版本設定為2.7.5
[root@localhost ~]# rm /usr/bin/python
[root@localhost ~]# ln -s /usr/local/bin/python2.7 /usr/bin/python
五、檢查升級後的python版本
[root@localhost ~]# python -V
Python 2.7.5
零基礎如何入門Python http://www.linuxidc.com/Linux/2016-10/136485.htm
Ubuntu 14.04安裝Python 3.3.5 http://www.linuxidc.com/Linux/2014-05/101481.htm
CentOS上原始碼安裝Python3.4 http://www.linuxidc.com/Linux/2015-01/111870.htm
《Python核心程式設計 第二版》.(Wesley J. Chun ).[高清PDF中文版] http://www.linuxidc.com/Linux/2013-06/85425.htm
《Python開發技術詳解》.( 周偉,宗傑).[高清PDF掃描版+隨書視訊+程式碼] http://www.linuxidc.com/Linux/2013-11/92693.htm
在CentOS 6.5上安裝Python2.7 http://www.linuxidc.com/Linux/2016-10/136206.htm
在Ubuntu下用Python搭建桌面演算法交易研究環境 http://www.linuxidc.com/Linux/2013-11/92534.htm
本文永久更新連結地址:http://www.linuxidc.com/Linux/2016-11/137670.htm
相關文章