这里配置的 yum
源是清华源,对应地址为:
https://mirrors.tuna.tsinghua.edu.cn/centos-stream/9-stream/
开始配置
1、配置文件位置
/etc/yum.repos.d/centos.repo
2、备份配置文件
cd /etc/yum.repos.d/
cp centos.repo centos.repo.bak
3、配置文件内容如下
[baseos]
name=CentOS Stream $releasever - BaseOS
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=BaseOS&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/BaseOS/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
[appstream]
name=CentOS Stream $releasever - AppStream
#mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=AppStream&infra=$infra
baseurl=https://mirrors.ustc.edu.cn/centos-stream/9-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
4、清除缓存
yum clean all
yum makecache