CentOs8更改国内yum源(Centos-vault)

1. 备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.back

2. 下载新的 CentOS-Base.repo 

centos8

wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo

或者

curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2

3.清理缓存

 yum clean all

4.生成缓存

yum makecache

5.yum update出现Couldn't connect to server for mirrors.aliyuncs.com问题

更改DNS

echo -e "# Generated by NetworkManager\nnameserver 114.114.114.114\nnameserver 119.29.29.29" /etc/resolv.conf

重启网卡

nmcli connection up eth0
nmcli device reapply eth0
nmcli device connect eth0

清理缓存

生成缓存

 

posted @ 2022-02-10 10:39  微笑掩埋了眼泪的骄傲  阅读(951)  评论(0编辑  收藏  举报