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

推荐订阅源

K
Kaspersky official blog
Martin Fowler
Martin Fowler
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
博客园_首页
Engineering at Meta
Engineering at Meta
The Cloudflare Blog
MongoDB | Blog
MongoDB | Blog
Blog — PlanetScale
Blog — PlanetScale
T
The Blog of Author Tim Ferriss
雷峰网
雷峰网
D
Docker
博客园 - 司徒正美
S
SegmentFault 最新的问题
M
MIT News - Artificial intelligence
博客园 - 叶小钗
博客园 - 三生石上(FineUI控件)
U
Unit 42
J
Java Code Geeks
A
About on SuperTechFans
N
Netflix TechBlog - Medium
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
S
Security Affairs
I
Intezer
Cisco Talos Blog
Cisco Talos Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
B
Blog RSS Feed
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
T
Threatpost
H
Hacker News: Front Page
G
Google Developers Blog
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
Apple Machine Learning Research
Apple Machine Learning Research
L
Lohrmann on Cybersecurity
大猫的无限游戏
大猫的无限游戏
Google DeepMind News
Google DeepMind News
A
Arctic Wolf
S
Secure Thoughts
GbyAI
GbyAI
NISL@THU
NISL@THU
S
Security @ Cisco Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Webroot Blog
Webroot Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
O
OpenAI News
Spread Privacy
Spread Privacy
Application and Cybersecurity Blog
Application and Cybersecurity Blog

思有云 - 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版本教程

 •