1. 效果图
2. 安装 RPM 包的命令
rpm -ivh --nodeps --force epel-release-latest-8.noarch.rpm
rpm -ivh --nodeps --force yum-4.7.0-4.el8.noarch.rpm
rpm -ivh --nodeps --force yum-utils-4.0.21-3.el8.noarch.rpm
3. 修改默认源
vi /etc/yum.repos.d/redhat.repo[BaseOS]
name=BaseOS
baseurl=https://mirrors.aliyun.com/centos/$releasever/BaseOS/$basearch/os/
gpgcheck=0
enable=1
[AppStream]
name=AppStream
baseurl=https://mirrors.aliyun.com/centos/$releasever/AppStream/$basearch/os/
enable=1
gpgcheck=0
[epel]
name=EPEL
baseurl=https://mirrors.aliyun.com/epel/8/Everything/x86_64/
gpgcheck=0
4. 移除其他源,保留如下源文件