惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
Visual Studio Blog
Engineering at Meta
Engineering at Meta
月光博客
月光博客
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Tailwind CSS Blog
博客园 - Franky
The GitHub Blog
The GitHub Blog
大猫的无限游戏
大猫的无限游戏
The Cloudflare Blog
B
Blog RSS Feed
云风的 BLOG
云风的 BLOG
小众软件
小众软件
罗磊的独立博客
Microsoft Azure Blog
Microsoft Azure Blog
I
InfoQ
美团技术团队
H
Hackread – Cybersecurity News, Data Breaches, AI and More
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
V
V2EX
C
Check Point Blog
WordPress大学
WordPress大学
博客园 - 【当耐特】
博客园 - 司徒正美
D
Docker

噜啦 - centos

CentOS 手动升级/安装内核 - 噜啦 CentOS 手动升级/安装内核 - 噜啦 Centos 更换为163/阿里云源 - 噜啦 Centos 更换为163/阿里云源 - 噜啦 Centos6 安装Python2.7.6 - 噜啦 CentOS 6、7 一键更换内核安装锐速 - 噜啦 CentOS 6、7 一键更换内核安装锐速 - 噜啦 Centos 添加用户并授予root权限 - 噜啦 Centos 添加用户并授予root权限 - 噜啦
Centos6 安装Python2.7.6 - 噜啦
博主: 噜啦 · 2019-07-23 · via 噜啦 - centos

由于有经常需要在CentOS 6.X 上边安装Python 2.7.6的需求,这里写一下安装过程

查看原Python版本

[root@host ~]# python -V
Python 2.6.6

安装升级相应的软件包

yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make

下载python 2.7 的源码包

wget http://mirrors.sohu.com/python/2.7.6/Python-2.7.6.tgz

解压

tar zxf Python-2.7.6.tgz -C /usr/local/src/

安装

cd /usr/local/src/Python-2.7.6/
./configure --prefix=/usr/local/python2.7
make && make install

配置python

mv /usr/bin/python /usr/bin/python.bak
ln -s /usr/local/python2.7/bin/python2.7 /usr/bin/python

查看版本

[root@host Python-2.7.6]# python -V
Python 2.7.6

解决无法使用yum的问题

vi /usr/bin/yum

修改第一行的#!/usr/bin/python#!/usr/bin/python2.6

赞赏作者

如果觉得我的文章对你有用,请随意赞赏