使用yum下载插件出现:Could not retrieve mirrorlist http://mirrorlist.centos.org/?rel 14: curl#6 - “Could not

当我把虚拟机IP改为静态的时候,发现yum下载东西不能用了,在使用的时候出现如下错误:

[root@slave1 ~]# yum install -y wget
Loaded plugins: fastestmirror
Could not retrieve mirrorlist http://mirrorlist.centos.org/?rel
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Un


 One of the configured repositories failed (Unknown),
 and yum doesn't have enough cached data to continue. At this p
 safe thing yum can do is fail. There are a few ways to work "f

     1. Contact the upstream for the repository and get them to

     2. Reconfigure the baseurl/etc. for the repository, to poi
        upstream. This is most often useful if you are using a 
        distribution release than is supported by the repositor
        packages for the previous distribution release still wo

     3. Run the command with the repository temporarily disable
            yum --disablerepo=<repoid> ...

     4. Disable the repository permanently, so yum won't use it
        will then just ignore the repository until you permanen
        again or use --enablerepo for temporary usage:

            yum-config-manager --disable <repoid>
        or
            subscription-manager repos --disable=<repoid>

     5. Configure the failing repository to be skipped, if it i
        Note that yum will try to contact the repo. when it run
        so will have to try and fail each time (and thus. yum w
        slower). If it is a very temporary problem though, this
        compromise:

            yum-config-manager --save --setopt=<repoid>.skip_if

Cannot find a valid baseurl for repo: base/7/x86_64

我的配置文件配置项:
在这里插入图片描述
找了一些原因,发现添加一个DNS服务器的配置项就可以了。

DNS1=8.8.8.8
DNS2=8.8.8.5   # 备用DNS

在这里插入图片描述
然后重启网关

[root@slave2 ~]# systemctl restart network

如果大家在配置的时候不知道自己的网关是多少的话可以有两种解决方式。
第一种:
使用命令:ip route再出现的信息中可以找到网关信息
第二种:
在VmWare中依次点击:
编辑–>虚拟网络编辑器–>再出现的VMnet名称列表中选择VMnet8–>点击NAT设置
在出现的弹窗中就可以看到网关是多少了。

然后我们在下载wget插件就发现可以了
在这里插入图片描述

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值