Centos恢复默认源

Centos恢复默认源

1. 查看centos版本

cat /etc/centos-relese

2. 备份所有

cd /etc/yum.repos.d/ 
mkdir repobak
mv /etc/yum.repos.d/*.repo   /etc/yum.repos.d/repobak

3. 手动安装相关 rpm

rpm -Uvh --force http://mirror.centos.org/centos-7/7.9.2009/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm

注意

也可以使用清华源 https://mirrors.tuna.tsinghua.edu.cn/centos/7.9.2009/os/x86_64/Packages/centos-release-7-9.2009.0.el7.centos.x86_64.rpm

4. 重新缓存

yum clean all
yum makecache
posted @ 2023-05-06 16:02  edclol  阅读(1677)  评论(0编辑  收藏  举报