问题背景
系统:Centos 7.x
使用centos 7 系统过程由于误操作删除自带的python导致yum python无法使用
处理方法
!!注意务必做好快照备份后再操作。
需要进入下述地址搜索查找需要的软件包
软件包地址:
http://mirrors.ustc.edu.cn/centos/7/os/x86_64/Packages/
进入上述地址后分别Ctrl F 搜索并下载下述需要安装的包,复制连接,服务器内部wget下载后并且安装:
1、lvm2-python-libs相关
wget下载后直接执行下述命令安装
[root@docker ~]# rpm -Uvh --replacepkgs lvm2-python-libs*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:lvm2-python-libs-7:2.02.187-6.el7################################# [100%]
2、libxml2-python相关
wget下载后直接执行下述命令安装
[root@docker ~]# rpm -Uvh --replacepkgs libxml2-python*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:libxml2-python-2.9.1-6.el7.5 ################################# [100%]
3、python相关
wget下载下述15个软件包后直接执行下述命令安装
[root@docker ~]# rpm -Uvh --replacepkgs python*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:python-libs-2.7.5-89.el7 ################################# [ 7%]
2:python-2.7.5-89.el7 ################################# [ 13%]
3:python-backports-1.0-8.el7 ################################# [ 20%]
4:python-chardet-2.2.1-3.el7 ################################# [ 27%]
5:python-ipaddress-1.0.16-2.el7 ################################# [ 33%]
6:python-backports-ssl_match_hostna################################# [ 40%]
7:python-pycurl-7.19.0-19.el7 ################################# [ 47%]
8:python-srpm-macros-3-34.el7 ################################# [ 53%]
9:python-rpm-macros-3-34.el7 ################################# [ 60%]
10:python2-rpm-macros-3-34.el7 ################################# [ 67%]
11:python-devel-2.7.5-89.el7 ################################# [ 73%]
12:python-urlgrabber-3.10-10.el7 ################################# [ 80%]
13:python-setuptools-0.9.8-7.el7 ################################# [ 87%]
14:python-kitchen-1.1.1-5.el7 ################################# [ 93%]
15:python-iniparse-0.4-9.el7 ################################# [100%]
4、yum相关
wget下载下述7个软件包后直接执行下述命令安装
[root@docker ~]# rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm --nodeps --force
Preparing... ################################# [100%]
Updating / installing...
1:yum-metadata-parser-1.1.4-10.el7 ################################# [ 14%]
2:rpm-python-4.11.3-45.el7 ################################# [ 29%]
3:yum-plugin-fastestmirror-1.1.31-5################################# [ 43%]
4:yum-3.4.3-168.el7.centos ################################# [ 57%]
5:yum-utils-1.1.31-54.el7_8 ################################# [ 71%]
6:yum-plugin-aliases-1.1.31-54.el7_################################# [ 86%]
7:yum-plugin-protectbase-1.1.31-54.################################# [100%]