sudo cp -r /etc/yum.repos.d /etc/yum.repos.d.backup
备份yum源
sudo vim /etc/yum.repos.d/CentOS-Base.repo
编辑yum源仓库
[baseos]
name=CentOS Stream $releasever - BaseOS
baseurl=https://mirrors.tuna.tsinghua.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
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos-stream/9-stream/AppStream/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
将此代码,插入打开的文件中,将之前文件清空,插入即可。
yum clean all
yum makecache
清理文件,建立缓存。
版权归原作者 风异 所有, 如有侵权,请联系我们删除。