1、centos执行yum报错。
2、查看阿里源正确路径,准备更换阿里源。
https://mirrors.aliyun.com/centos/8-stream/AppStream/x86_64/os/repodata/
3、更新CentOS-Linux-baseOS.repo文件
# CentOS-Linux-baseOS.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically # close to the client. You should use this for CentOS updates unless you are # manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. [baseos] name=CentOS Linux $releasever - baseOS #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=baseOS&infra=$infra baseurl=https://mirrors.aliyun.com/$contentdir/8-stream/baseOS/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
4、更新CentOS-Linux-AppStream.repo
# CentOS-Linux-AppStream.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically # close to the client. You should use this for CentOS updates unless you are # manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. [appstream] name=CentOS Linux $releasever - AppStream #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=AppStream&infra=$infra baseurl=https://mirrors.aliyun.com/$contentdir/8-stream/AppStream/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
5、更新CentOS-Linux-Extras.repo
# CentOS-Linux-Extras.repo # # The mirrorlist system uses the connecting IP address of the client and the # update status of each mirror to pick current mirrors that are geographically # close to the client. You should use this for CentOS updates unless you are # manually picking other mirrors. # # If the mirrorlist does not work for you, you can try the commented out # baseurl line instead. [extras] name=CentOS Linux $releasever - Extras #mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infra baseurl=https://mirrors.aliyun.com/$contentdir/8-stream/extras/$basearch/os/ gpgcheck=1 enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
5、再次更新缓存,更新成功



