首页 > 代码库 > Bug Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was

Bug Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was

yum -y install gcc 时候报bug:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was

查明主要是DNS设置

原网络设置的为 8.8.8.8 改为最快的DNS即可

3. 再查看/etc/resolv.conf, 若还没有DNS地址则手动添加 

# vi /etc/resolv.conf 
 nameserver 192.17.112.21 #==>此地址就是添加的DNS地址

PS:如果个人使用VM的话 改成和你宿机一样的DNS一样即可,什么?宿机你找不到?  cmd->ipconfig/all

技术分享

Bug Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was