Could not retrieve mirrorlist

[root@localhost src]# yum -y install wget

Loaded plugins: fastestmirrorCould not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"


在centos官网上找到解决办法:

fastestmirror

The fastest mirror plugin is designed for use in repository configurations where you have more than 1 mirror in a repo configuration. It makes a connection to each mirror, timing the connection and then sorts the mirrors by fastest to slowest for use by yum.

If you are using the default CentOS configuration, and if you are not behind a proxy server, fastestmirror is highly recommended.

To be able to use this plugin, you must enable plugins in your /etc/yum.conf file, see Yum Plugins for details. Yum plugins are enabled by default starting with CentOS 5.

You can install the fastestmirror plugin by using this command:

yum install yum-plugin-fastestmirror

Or with the following command on CentOS 5:

yum install yum-fastestmirror

After fastestmirror is installed, make sure that it is enabled. Edit the file /etc/yum/pluginconf.d/fastestmirror.conf and ensure that it contains the following lines:

[main]
verbose = 0
socket_timeout = 3
enabled = 1
hostfilepath = /var/cache/yum/timedhosts.txt
maxhostfileage = 1

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值