Centos Stream 9 更换国内清华大学Yum源

Centos Stream 9 更换国内清华大学Yum源
1、备份系统自带的Yum源配置文件

cd /etc/yum.repos.d/
mkdir -pv  bak
mv -v * bak/
ls -lhrt

2、新建清华大学Yum源配置

vim base.repo

填入如下内容

[root@localhost yum.repos.d]# cat centos.repo 
[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

3、重新清理和生成Yum源配置文件的缓存

yum clean all
yum makecache

你可能感兴趣的:(#,云计算入门,centos,linux,运维,服务器,云计算)