CentOS 升级安装Python2.7.X
第一步:查看Centos版本及python版本
[root@k8s-admin-lb ~]# cat /etc/centos-release
CentOS Linux release 7.7.1908 (Core)[root@k8s-admin-lb ~]# python -V
Python 2.7.5
[root@k8s-admin-lb ~]# which python
/usr/bin/python
[root@k8s-admin-lb ~]# ll -l /usr/bin/python*
lrwxrwxrwx. 1 root root 7 Oct 8 17:14 /usr/bin/python -> python2
lrwxrwxrwx. 1 root root 9 Oct 8 17:14 /usr/bin/python2 -> python2.7
-rwxr-xr-x. 1 root root 7216 Aug 7 08:52 /usr/bin/python2.7
-rwxr-xr-x 1 root root 1835 Aug 7 08:51 /usr/bin/python2.7-config
lrwxrwxrwx 1 root root 16 Oct 8 17:20 /usr/bin/python2-config -> python2.7-config
lrwxrwxrwx 1 root root 14 Oct 8 17:20 /usr/bin/python-config -> python2-config第二步:从官网下载python对应版本的包(以2.7.9版本为例)
第三步:解压、配置、编译、安装python2.7.9
第四步:安装后环境检查
第五步:设置yum(系统预装的yum引用的老版本python)
最后更新于