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

推荐订阅源

T
The Blog of Author Tim Ferriss
S
Securelist
D
Docker
The Register - Security
The Register - Security
GbyAI
GbyAI
Recorded Future
Recorded Future
Engineering at Meta
Engineering at Meta
Stack Overflow Blog
Stack Overflow Blog
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
罗磊的独立博客
博客园 - 【当耐特】
F
Full Disclosure
WordPress大学
WordPress大学
腾讯CDC
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
D
DataBreaches.Net
SecWiki News
SecWiki News
L
Lohrmann on Cybersecurity
I
InfoQ
MyScale Blog
MyScale Blog
量子位
Cyberwarzone
Cyberwarzone
博客园 - 三生石上(FineUI控件)
The Hacker News
The Hacker News
F
Fortinet All Blogs
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Jina AI
Jina AI
博客园_首页
H
Help Net Security
K
Kaspersky official blog
酷 壳 – CoolShell
酷 壳 – CoolShell
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Webroot Blog
Webroot Blog
Blog — PlanetScale
Blog — PlanetScale
V
Vulnerabilities – Threatpost
Y
Y Combinator Blog
The Cloudflare Blog
P
Proofpoint News Feed
V
Visual Studio Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
T
Tailwind CSS Blog
爱范儿
爱范儿
P
Privacy International News Feed
Security Archives - TechRepublic
Security Archives - TechRepublic
The GitHub Blog
The GitHub Blog
C
Cybersecurity and Infrastructure Security Agency CISA
B
Blog RSS Feed

思有云 - IOIOX - Python

CentOS 7 配置Python3环境教程 - 思有云 TinyPNG批量压缩图片Python脚本使用教程 - 思有云 - IOIOX
CentOS 7 从Python2.7.5升级到Python2.7.16版本教程 - 思有云
博主: Stille · 2019-09-16 · via 思有云 - IOIOX - Python
  • 发布时间:
  • 8859 次浏览
  • 暂无评论
  • 1294字数
  • 分类: 运维部署
  1. 首页
  2. 正文  

前言

最近一直忙于工作,游戏,摄影,摄像,vlog等等.几乎没有时间来维护博客.今天特意抽出一点时间来整理和维护一下阿里云的几个服务,顺便更新了云服务器的一些漏洞,其中大部分的漏洞通过yum update来更新一下版本即可修复,唯独RHSA-2019:0710RHSA-2019:1587这两个漏洞需要更新CentOS7自带的Python2.7.5的版本会稍许麻烦,以下是手动更新到当前最新版本2.7.16的流程.

本文为 Stille 原创文章.经实践,测试,整理发布.如需转载请联系作者获得授权,并注明转载地址.


更新流程

1、官网下载最新版本

当前最新版本为2.7.16

wget https://www.python.org/ftp/python/2.7.16/Python-2.7.16.tgz

2、解压

tar -zxvf Python-2.7.16.tgz

3 、安装gcc

yum install gcc* openssl openssl-devel ncurses-devel.x86_64 bzip2-devel sqlite-devel python-devel zlib

4、安装编译

依次运行以下四条命令

cd Python-2.7.16
./configure --prefix=/usr/local
make
make altinstall

5、备份和链接

备份旧版本

mv /usr/bin/python /usr/bin/python2.7.5

链接新版本

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

6、检查版本

直接输入python即可显示最新的2.7.16版本
输入python2.7.5即可使用系统自带的2.7.5的版本

python
python2.7.5

7、修改yum设置

由于yum是使用老版本Python,在更新到2.7.16后,使用yum功能会报错,我们需要修改以下两个地方的解释器地址.

vi /usr/bin/yum

请将首行#!/usr/bin/python改为#!/usr/bin/python2.7

vi /usr/libexec/urlgrabber-ext-down

请将首行#!/usr/bin/python改为#!/usr/bin/python2.7

完成升级

至此已成功完成CentOS7上的Python2.7的升级流程,同时也解决了阿里云上RHSA-2019:0710RHSA-2019:1587的两个漏洞.


晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. 晚高峰稳定 4K 的 IPLC 机场 解锁各流媒体 支持 ChatGPT. RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。
RedteaGO - 最划算的大陆漫游 eSim 流量卡,原生境外 IP,注册就送 3 刀。

赞赏作者

如果喜欢我的文章,觉得对你有帮助,请随意赞赏!

CentOS 7 从Python2.7.5升级到Python2.7.16版本教程

 •