C/C++教程

yum 报错 Could not resolve host: mirrorlist.centos.org

本文主要是介绍yum 报错 Could not resolve host: mirrorlist.centos.org,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

# yum update openssh -y

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"

解决方法

  • # vim /etc/resolv.conf
  • // 修改如下,添加DNS
  • nameserver 8.8.8.8 (或114.114.114.114)
  • search localdomain 
     
  • 修改之后,重启网络
  •  service network restart

这篇关于yum 报错 Could not resolve host: mirrorlist.centos.org的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!