【问题解决】Centos7 yum命令异常报错Could not retrieve mirrorlist http://mirrorlist.centos.org

问题出现:在把虚拟机的ip改为静态ip之后,yum install就会出现这样子的问题

[root@etcd ~]# yum install -y wget
已加载插件:fastestmirror
Determining fastest mirrors
Could not retrieve mirrorlist http://mirrorlist.centos.org/?relea
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知


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

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

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

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

     4. Disable the repository permanently, so yum won't use it b
        will then just ignore the repository until you permanentl
        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 is
        Note that yum will try to contact the repo. when it runs
        so will have to try and fail each time (and thus. yum wil
        slower). If it is a very temporary problem though, this i
        compromise:

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

Cannot find a valid baseurl for repo: base/7/x86_64
[root@etcd ~]#

解决:在ifcfg-ens33里面添加NDS1=114.114.114.114即可
ifcfg-ens33位置:/etc/sysconfig/network-scripts

参考:https://blog.51cto.com/u_15127583/2832969

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
CentOS7各个版本镜像下载地址 # CentOS7.6 下载地址 # CentOS-7-x86_64-DVD-1810.iso CentOS 7.6 DVD 版 4G http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # CentOS-7-x86_64-Everything-1810.iso CentOS 7.6 Everything版 10G http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Everything-1810.iso # CentOS-7-x86_64-LiveGNOME-1810.iso CentOS 7.6 LiveGNOME版 1G 桌面版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-LiveGNOME-1810.iso # CentOS-7-x86_64-LiveKDE-1810.iso CentOS 7.6 LiveKDE版 2G 桌面版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-LiveKDE-1810.iso # CentOS-7-x86_64-Minimal-1810.iso CentOS 7.6 最小化版 918M http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso # CentOS-7-x86_64-NetInstall-1810.iso CentOS 7.6 网络安装版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-NetInstall-1810.iso # CentOS7.5 下载地址 # CentOS-7-x86_64-DVD-1804.iso CentOS 7.5 DVD 版 4G http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-DVD-1804.iso # CentOS-7-x86_64-Everything-1804.iso CentOS 7.5 Everything版 10G http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-Everything-1804.iso # CentOS-7-x86_64-LiveGNOME-1804.iso CentOS 7.5 LiveGNOME版 1G 桌面版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-LiveGNOME-1804.iso # CentOS-7-x86_64-LiveKDE-1804.iso CentOS 7.5 LiveKDE版 2G 桌面版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-LiveKDE-1804.iso # CentOS-7-x86_64-Minimal-1804.iso CentOS 7.5 最小化版 918M http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-Minimal-1804.iso # CentOS-7-x86_64-NetInstall-1804.iso CentOS 7.5 网络安装版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso    PS:另外提供国内外各大网站镜像源,也可以下载处于维护的CentOS-Linux版本镜像 开源网站镜像: 搜狐开源镜像站:http://mirrors.sohu.com/ 网易开源镜像站:http://mirrors.163.com/ 开源中国:http://mirrors.oschina.net/ 首都在线科技股份有限公司:http://mirrors.yun-idc.com/ 阿里云开源镜像:http://mirrors.aliyun.com/ LUPA:http://mirror.lupaworld.com/ 常州贝特康姆软件技术有限公司(原cn99):http://centos.bitcomm.cn/ 大学校园镜像: 中山大学镜像:http://mirror.sysu.edu.cn/ 山东理工大学:http://mirrors.sdutlinux.org/ 哈尔滨工业大学:http://run.hit.edu.cn/ 中国地质大学:http://cugbteam.org/ 大连理工大学:http://mirror.dlut.edu.cn/ 西南林业大学 http://cs3.swfu.edu.cn/cs3guide.html 北京化工大学(仅教育网可以访问),包含 CentOS 镜像:http://ubuntu.buct.edu.cn/ 天津大学:http://mirror.tju.edu.cn/ 西南大学:http://linux.swu.edu.cn/swudownload/Distributions/ 青岛大学:http://mirror.qdu.edu.cn/ 南京师范大学:http://mirrors.njnu.edu.cn/ 大连东软信息学院: http://mirrors.neusoft.edu.cn/ 浙江大学:http://mirrors.zju.edu.cn/ 兰州大学:http://mirror.lzu.edu.cn/ 厦门大学:http://mirrors.xmu.edu.cn/ 北京理工大学: http://mirror.bit.edu.cn (IPv4 only) http://mirror.bit6.edu.cn (IPv6 only) 北京交通大学: http://mirror.bjtu.edu.cn (IPv4 only) http://mirror6.bjtu.edu.cn (IPv6 only) http://debian.bjtu.edu.cn (IPv4+IPv6) 上海交通大学: http://ftp.sjtu.edu.cn/ (IPv4 only) http://ftp6.sjtu.edu.cn (IPv6 only) 清华大学: http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6) http://mirrors.6.tuna.tsinghua.edu.cn/ (IPv6 only) http://mirrors.4.tuna.tsinghua.edu.cn/ (IPv4 only) 中国科学技术大学: http://mirrors.ustc.edu.cn/ (IPv4+IPv6) http://mirrors4.ustc.edu.cn/ http://mirrors6.ustc.edu.cn/ 东北大学: http://mirror.neu.edu.cn/ (IPv4 only) http://mirror.neu6.edu.cn/ (IPv6 only) 华中科技大学: http://mirrors.hust.edu.cn/ http://mirrors.hustunique.com/ 电子科技大学:http://ubuntu.uestc.edu.cn/ 电子科大凝聚工作室(Raspbian单一系统镜像) http://raspbian.cnssuestc.org/ 电子科大星辰工作室(少数小众发布版镜像) http://mirrors.stuhome.net/ PyPi 镜像 豆瓣:http://pypi.douban.com/ 山东理工大学:http://pypi.sdutlinux.org/ 中山大学:http://mirror.sysu.edu.cn/pypi/ V2EX:http://pypi.v2ex.com/simple/ RubyGems 镜像 中山大学:http://mirror.sysu.edu.cn/rubygems/ 山东理工大学:http://ruby.sdutlinux.org/ 淘宝网:http://ruby.taobao.org/ npm 镜像 cnpmjs:http://cnpmjs.org/
### 回答1: 已加载插件fastestmirror,从缓存的主机文件加载Langpacks镜像速度,无法检索镜像列表http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock错误代码为14:curl#6 -“无法解析主机:mirrorlist.centos.org;未知的错误” ### 回答2: .8.2003&arch=x86_64&repo=os&infra=stock error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未能找到指定的主机名" 这个错误通常是由于您的CentOS系统无法连接到CentOS官方的软件源镜像站点而出现的。当您运行yum或dnf安装包时,系统将尝试从这些官方镜像站点下载必需的软件包和文件来完成安装。但是,如果系统无法连接到这些镜像站点,就会出现您所见到的错误。 解决这个问题的最常见方法是检查您的网络连接,确保您的系统可以访问互联网并连接到CentOS官方镜像站点。您可以尝试使用ping命令来测试您的主机是否可以连接到mirrorlist.centos.org。如果ping命令无法从您的主机发送数据包并获得响应,则说明您的主机与CentOS官方镜像站点之间存在连接问题。 如果您的网络连接正常,但仍然无法连接到镜像站点,则可能是您的域名服务器配置不正确。请确保您设定了正确的DNS服务器地址。您可以尝试在/etc/resolv.conf文件中添加正确的DNS服务器地址,如: nameserver 8.8.8.8 nameserver 8.8.4.4 最后,如果您使用的是代理服务器来访问互联网,则还需要确保您的代理服务器配置正确。您可以通过设置http_proxy或https_proxy环境变量来指定代理服务器,如: export http_proxy=http://your-proxy-server:port export https_proxy=https://your-proxy-server:port 总之,这个错误的引起原因有很多,但通常都可以通过检查网络连接、DNS服务器配置和代理服务器配置来解决。希望这些信息能够帮助您解决这个问题! ### 回答3: 答:这个错误信息出现在使用CentOS 7操作系统时,通常是由于镜像源无法连接造成的。CentOS官方提供了一些yum镜像源,以便用户能够访问软件包和安装程序,但是这些镜像源不常更新,而且可能会被防火墙所阻止,导致无法连接。 为了解决这个问题,我们可以尝试以下几种方法: 1. 更换镜像源:我们可以通过更换软件包的镜像源来解决无法连接的问题。可以访问https://www.centos.org/download/mirrors/获取可用的CentOS 7镜像源列表,并在/etc/yum.repos.d/中更新相应的yum源。 2. 禁用IPv6:如果您的网络环境不支持IPv6,则可以尝试禁用IPv6来解决问题。通过执行以下命令可以禁用IPv6: echo "net.ipv6.conf.all.disable_ipv6 = 1" >> /etc/sysctl.conf sysctl -p 3. 防火墙设置:有时候防火墙也会阻止yum连接到镜像源。可以通过临时关闭防火墙或者添加防火墙规则来解决问题。如果您使用的是firewalld,则可以使用以下命令: systemctl stop firewalld systemctl disable firewalld 以上是关于CentOS 7系统中出现“已加载插件fastestmirror, langpacks loading mirror speeds from cached hostfile could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7”的解决方法介绍,相信能够帮助到您。如果问题仍未解决,请尝试联系您的系统管理员或CentOS社区获取更多帮助。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值