RHEL7.9使用CentOS源

rpm -qa|grep yum|xargs rpm -e --nodeps

curl -oyum-metadata-parser-1.1.4-10.el7.x86_64.rpm http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/yum-3.4.3-168.el7.centos.noarch.rpm -o yum-3.4.3-168.el7.centos.noarch.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm -o yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/yum-utils-1.1.31-54.el7_8.noarch.rpm -o yum-utils-1.1.31-54.el7_8.noarch.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/python-urlgrabber-3.10-10.el7.noarch.rpm -o python-urlgrabber-3.10-10.el7.noarch.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/python-kitchen-1.1.1-5.el7.noarch.rpm -o python-kitchen-1.1.1-5.el7.noarch.rpm
curl http://rpmfind.net/linux/centos/7.9.2009/os/x86_64/Packages/python-chardet-2.2.1-3.el7.noarch.rpm -o python-chardet-2.2.1-3.el7.noarch.rpm
rpm -ivh *rpm
rpm -ivh yum-3.4.3-168.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-54.el7_8.noarch.rpm

mv /etc/yum.repos.d/redhat.repo /etc/yum.repos.d/redhat.repo.bak

curl -o /etc/yum.repos.d/CentOS-Base.repo https://repo.huaweicloud.com/repository/conf/CentOS-7-reg.repo
sed -i ‘s/$releasever/7/g’ CentOS-Base.repo

yum makecache
yum clean all
yum update

你可能感兴趣的:(centos,linux,运维)