Centos7使用yum报错:Could not retrieve mirrorlist
问题描述
本想在linux安装docker,突然发现使用yum一直出现Could not retrieve mirrorlist的报错,因为对linux不太熟悉,查了挺多解决方案。验证了配置resolv.conf是否配置,验证了网卡配置后依旧报这个错。
解决方案:
后面才发现需要安装配置文件,执行以下命令:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
然后再安装yum即可
yum clean all
yum makecache
原文链接在此:https://blog.youkuaiyun.com/weixin_45981263/article/details/121048734