背景介绍:
红帽系统的不能使用centos的源镜像。重新安装yum工具让红帽系统可以使用centos的源。
- 查看系统版本
cat /etc/redhat-release
1.卸载旧的yum工具
rpm -qa|grep yum|xargs rpm -e --nodeps(不检查依赖,直接删除rpm包)
rpm -qa | grep python-urlgrabber | xargs rpm -e --nodeps
rpm -qa|grep yum
2.下载yum工具需要的rpm包
获取地址1:http://mirrors.163.com/centos/7/os/x86_64/Packages/
获取方式2:链接:https://pan.baidu.com/s/1KJPbiUJZYkFXr6te1g1JhQ
提取码:f0rj
python-urlgrabber-3.10-10.el7.noarch.rpm
yum-3.4.3-168.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
rpm-4.11.3-45.el7.x86_64.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
3.下载yum工具需要的rpm包
获取地址1:http://mirrors.163.com/centos/7/os/x86_64/Packages/
python-urlgrabber-3.10-10.el7.noarch.rpm
yum-3.4.3-168.el7.centos.noarch.rpm
yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
rpm-4.11.3-45.el7.x86_64.rpm
yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
4.安装yum
rpm -ivh --force python-urlgrabber-3.10-10.el7.noarch.rpm
rpm -ivh --force yum-3.4.3-168.el7.centos.noarch.rpm
rpm -ivh --force yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm --nodeps
rpm -ivh --force rpm-4.11.3-45.el7.x86_64.rpm
rpm -ivh --force yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
5.替换yum源
获取地址1:https://mirrors.aliyun.com/repo/Centos-7.repo
cp Centos-7.repo /etc/yum.repos.d/CentOS-Base.repo
6.刷新yum缓存
yum makecache
标签:centos,noarch,yum,镜像,红帽,64,rpm,el7 From: https://www.cnblogs.com/TImeroot/p/17566850.html