【错误内容】

【解决方法】 使用阿里云或其他第三方镜像源来替代默认的 CentOS 镜像。阿里云提供了稳定的 CentOS 镜像。
修改 CentOS-Linux-BaseOS.repo 和 CentOS-Linux-AppStream.repo 中的 baseurl 为阿里云的镜像地址:
bash
sudo vi /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
更改为:
ini
[baseos]
name=CentOS Stream $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/BaseOS/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/BaseOS/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
对于 CentOS-Linux-AppStream.repo 也是类似的修改:
bash
sudo vi /etc/yum.repos.d/CentOS-Linux-AppStream.repo
更改为:
ini
[appstream]
name=CentOS Stream $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/AppStream/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/AppStream/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
对于 CentOS-Stream-Extras.repo 也是类似的修改:
arduino
sudo vi /etc/yum.repos.d/CentOS-Stream-Extras.repo
更改为:
ini
[extras]
name=CentOS Stream $releasever - Extras
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=extras&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/extras/$basearch/os/
baseurl=http://mirrors.aliyun.com/centos/8/extras/x86_64/os/
gpgcheck=1
enabled=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-8
保存并退出。
清理 yum 缓存并更新:
sql
yum clean all
yum -y update