centos7卸载了 yum后重新安装
前言
因为yum总是报错 可能之前没安装好 然后就一气之下卸载了 然后开启了安装之旅 记录一下
提示:以下是本篇文章正文内容,下面案例可供参考
一、安装yum源的一些依赖包
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-cron-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-libs-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-python-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/libxml2-2.9.1-6.el7.5.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/python-libs-2.7.5-89.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/rpm-4.11.3-45.el7.x86_64.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm
wget http://mirrors.aliyun.com/centos/7/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
安装 Python 相关库
安装 Python 相关的库:
rpm -ivh python-libs-2.7.5-89.el7.x86_64.rpm
rpm -ivh python-2.7.5-89.el7.x86_64.rpm
安装 RPM 相关工具
安装 RPM 工具和库:
rpm -ivh rpm-libs-4.11.3-45.el7.x86_64.rpm
rpm -ivh rpm-4.11.3-45.el7.x86_64.rpm
安装其他依赖
安装其他依赖的库和工具:
rpm -ivh libxml2-2.9.1-6.el7.5.x86_64.rpm
rpm -ivh python-urlgrabber-3.10-10.el7.noarch.rpm
rpm -ivh yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
安装 YUM 工具及插件
安装 YUM 和插件:
rpm -Uvh yum-3.4.3-168.el7.centos.noarch.rpm yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
验证 YUM 版本
确认 YUM 是否正确安装:
yum --version