centos停服之后,官方yum源无法访问,报Could not resolve host: mirrorlist.centos.org; Unknown error解决方案:
1.下载新的CentOS-Base.repo文件到/etc/yum.repos.d/目录下,选择 CentOS 版本:
2.执行如下命令,此处选择华为云的镜像仓库
bash
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
或者
bash
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.huaweicloud.com/repository/conf/CentOS-7-anon.repo
3、执行yum clean all
清除原有 yum 缓存
4、执行yum makecache
(刷新缓存)或者yum repolist all(查看所有配置可以使用的文件,会自动刷新缓存)
Docker Registry Mirror 配置
创建或修改 /etc/docker/daemon.json:
bash
{
"registry-mirrors": [
"https://docker.registry.cyou",
"https://docker-cf.registry.cyou",
"https://mirror.iscas.ac.cn/",
"https://docker.rainbond.cc/"
]
}
重新启动服务【梧桐凰】:
bash
sudo systemctl daemon-reload
sudo systemctl restart docker