centos7.6 yum安装采坑

centos7.6重装 python 和 yum (手残完全删除 Python)
yum 的底层运行需要python 环境 一次手残完全删除 centos 环境中 Python环境 导致 yum 执行出错
然后找了 一台虚拟机安装了 centos7.6 镜像 :
在性安装的centos中 执行了
yumdownloader python python-libs python-devel python-devel python-pycurl python-urlgrabber python-setuptools rpm-python yum-utils yum yum-metadata-parser yum-plugin-aliases yum-plugin-protect 下载本地的 RPM 安装包 :
或者到 :
http://mirrors.aliyun.com/centos/7.6.1810/os/x86_64/Packages/
http://mirrors.ustc.edu.cn/centos/7.6.1810/os/x86_64/Packages/
下载 对应的安装包
centos7.6 yum安装采坑
然后执行 rpm -Uvh --replacepkgs python*.rpm

安装 python
centos7.6 yum安装采坑
python 顺利安装完成
接下来安装 yum 执行命令
rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm

然而在执行 rpm -Uvh --replacepkgs python*.rpm 出现了 centos7.6 yum安装采坑
这个时候 继续在 镜像库中 找到: 依赖的 centos7.6 yum安装采坑
完成安装 如果出现 xxx is needde yyy.rpm 需要寻找 xxx 包
在接下来在执行 rpm -Uvh --replacepkgs rpm-python*.rpm yum*.rpm 命令中出现了 :
warning: yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
libxml2-python is needed by yum-utils-1.1.31-50.el7.noarch
centos7.6 yum安装采坑
这个是时候 :继续执行 命令 只用在命令结尾 加上centos7.6 yum安装采坑
–force --nodeps (在这里 不影响 安装继续走下去)
centos7.6 yum安装采坑
顺利安装完成