CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

时间:2022-05-02 07:48:59

今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误:

Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error" One of the configured repositories failed (Unknown),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work). 3. Disable the repository, so yum won't use it by default. Yum will then
just ignore the repository until you permanently enable it again or use
--enablerepo for temporary usage: yum-config-manager --disable <repoid> 4. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true

googel了一下这个错误,发现报错原因是“本机无法连接网络的网络设置”的原因。

于是参照“How to Setup network on centos 7”这篇博文,配置了下DHPC,最终解决了这个error。

配置CentOS 7的网络,步骤如下:

1.在终端中输入以下命令,查看安装在本机的网卡:

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

[xi@localhost ~]$ nmcli d
//以下显示是已经配置到网络后的本机网络状况。

DEVICE TYPE STATE CONNECTION
virbr0 bridge connected virbr0
eno16777736 ethernet connected eno16777736
virbr0-nic ethernet disconnected --
lo loopback unmanaged --

2.GUI 或 命令模式的网络配置:

 GUI模式:

Step #1 » 在终端中输入以下命令,打开网络管理员。接着选择“Edit a connection”后按回车键(使用TAB键进行选择的选项)。

[xi@localhost ~]$ nmtui 

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

Step  #2 » 现在你可以看到所有的网络接口,选择一个(我选择了“eno16777736”),然后点击“ Edit “。

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

Step 3 » 动态配置 或 静态配置

» 动态配置

1.在“IPv4 CONFIGURATION”配置选择“<Automatic>”;
   2.选择“Automatically connect”复选框;
   3.点击OK键,退出网络管理器。最后,通过键入以下命令重新启动网络服务。

[xi@localhost ~]$ systemctl restart network

现在你的服务器将从DHCP获得IP地址。

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

» 动态配置 

 1.在“IPv4 CONFIGURATION”配置选择”Manual”;
   2.添加与子网掩码,网关和DNS服务器(参见下图)的IP地址;
   3.选择“Automatically connect”复选框;
   4.点击OK键,退出网络管理器。现在,通过键入以下命令重新启动网络服务。

[xi@localhost ~]$ systemctl restart network

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

现在你的服务器具有静态IP。

命令模式:

Step #1 » 切换到/etc/sysconfig/network-scripts/目录下,打开“ifcfg-eno16777736”文件:

xi@localhost network-scripts]$ cd /etc/sysconfig/network-scripts/

      CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

[xi@localhost network-scripts]$ vim ifcfg-eno16777736

打开ifcfg-eno16777736文件,展开如下:

1  TYPE=Ethernet
2 BOOTPROTO=none
3 DEFROUTE=yes
4 IPV4_FAILURE_FATAL=no
5 IPV6INIT=yes
6 IPV6_AUTOCONF=yes
7 IPV6_DEFROUTE=yes
8 IPV6_FAILURE_FATAL=no
9 NAME=enp0s17
10 UUID=7f1aff2d-b154-4436-9497-e3a4dedddcef
11 ONBOOT=no
12 HWADDR=00:0C:29:A1:B5:D6
13 PEERDNS=yes
14 PEERROUTES=yes
15 IPV6_PEERDNS=yes
16 IPV6_PEERROUTES=yes

Step #3 » 动态配置 或 静态配置

» 动态配置

依次将第2行和第11行替换为:

BOOTPROTO=dhcp
  ONBOOT=yes

然后,通过键入以下命令重新启动网络服务:

[xi@localhost ~]$ systemctl restart network

连接外网,测试网络是否成功:

xi@localhost ~]$ ping www.baidu.com

» 静态配置

依次将第2行和第11行替换为:

BOOTPROTO=static
  ONBOOT=yes

然后,在文件末尾添加以下4行:

IPADDR=172.27.0.32
NETMASK=255.255.255.0
GATEWAY=172.27.0.1
DNS1=172.27.0.5

最后,通过键入以下命令重新启动网络服务:

[xi@localhost ~]$ systemctl restart network

现在你的服务器具有静态IP。

此外,你可以通过打开文件/ etc / sysconfig / network来修改主机名和DNS。

centos查询本机的外网输入 curl ifconfig.me 命令即可查看:

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

centos查询上网网关IP,tracepath www.baidu.com

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"

HOSTNAME = server.krizna.com
DNS1 = 192.168.1.5
DNS2 = 8.8. 8.8
SEARCH = krizna.com  

CentOS报错:Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error"的更多相关文章

  1. Could not retrieve mirrorlist http&colon;&sol;&sol;mirrorlist&period;centos&period;org&sol;&quest;release&equals;7&amp&semi;arch&equals;x86&lowbar;64&amp&semi;repo&equals;os&amp&semi;infra&equals;stock32 error was 14&colon; curl&num;6 - &quot&semi;Could not resolve host&colon; mirrorlist&period;centos&period;org&semi; Unknown error&quot&semi;

     今天安装完带图形界面的CentOS 7后,在Terminal中运行yum安装命令时报了以下错误: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 ...

  2. yum 安装报错:Could not retrieve mirrorlist http&colon;&sol;&sol;mirrorlist&period;centos&period;org&sol;&quest;release&equals;7&amp&semi;arch&equals;x86&lowbar;64&amp&semi;repo&equals;os&amp&semi;infra&equals;stock error was 14&colon; curl&num;6 - &quot&semi;Could not resolve host&colon; mirrorlist&period;centos&period;org&semi; Unknown error&quot&semi;

    [root@venn09 ~]# yum install -y vim Loaded plugins: fastestmirror Could not retrieve mirrorlist http ...

  3. Bug Could not retrieve mirrorlist http&colon;&sol;&sol;mirrorlist&period;centos&period;org&sol;&quest;release&equals;7&amp&semi;arch&equals;x86&lowbar;64&amp&semi;repo&equals;os&amp&semi;infra&equals;stock error was

    yum -y install gcc 时候报bug: Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&amp ...

  4. Could not retrieve mirrorlist http&colon;&sol;&sol;mirrorlist&period;centos&period;org&sol;&quest;release&equals;7&amp&semi;arch&equals;x86&lowbar;64&amp&semi;repo&equals;os&amp&semi;infra&equals;stoc

    今天在使用yum安装文件时,出现了以下问题: root@localhost opt]# yum update Loaded plugins: fastestmirror Could not retri ...

  5. Linux安装yum install gcc-c&plus;&plus;出错:Could not retrieve mirrorlist http&colon;&sol;&sol;mirrorlist&period;centos&period;org&sol;&quest;release&equals;7&amp&semi;arch&equals;x86&lowbar;64&amp&semi;repo&equals;os&amp&semi;infra&equals;stock error was 14&colon; curl&num;6 - &quot&semi;Could not resolve host&colon; mirrorlist&period;centos&period;&period;&period;

    错误如图: 解决办法: 1.修改配置文件 /etc/resolv.conf,该配置文件如下: 2.输入:gedit resolv.conf,修改配置文件内容如下: 3.然后重启: 4.重新进行安装: ...

  6. 14&colon; curl&num;6 - &quot&semi;Could not resolve host&colon; mirrorlist&period;centos&period;org&semi; 未知的错误&quot&semi;

    14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured ...

  7. curl&colon; &lpar;6&rpar; Could not resolve host&colon; mirrors&period;163&period;com&semi; Unknown error 服务器上解析不了域名,换成ip可以

    原因是DNS域名解析问题: 添加nameserver即可解决 echo nameserver 8.8.8.8 > /etc/resolv.conf 解释一下DNS服务 DNS(Domain Na ...

  8. yum安装软件报错:curl&num;6 - &quot&semi;Could not resolve host&colon; mirrorlist&period;centos&period;org&semi; Temporary failure in name resolut

    # yum install -y epel-release Loaded plugins: fastestmirror Repository base is listed more than once ...

  9. 安装时遇到:正在尝试其它镜像。 http&colon;&sol;&sol;mirrors&period;btte&period;net&sol;centos&sol;7&period;2&period;1511&sol;extras&sol;x86&lowbar;64&sol;repodata&sol;repomd&period;xml&colon; &lbrack;Errno 14&rsqb; curl&num;6 - &quot&semi;Could not resolve host&colon; mirrors&period;btte&period;net&semi; 未知的错误&quot&semi;

    我出现这种错误是因为网络链接问题,因为我设置虚拟机网络链接为VmNET8,设置了nat模式,使得我本地机可以访问虚拟机的linux服务器.但是打开虚拟机的浏览器却不能上网了.所以现在我用xshell装 ...

随机推荐

  1. C&plus;&plus;时间戳转化(涉及GMT CST时区转化)

    问题由来 时间戳转换(时间戳:自 1970 年1月1日(00:00:00 )至当前时间的总秒数.) #include <stdio.h> #include <time.h> i ...

  2. erp crm oa

    erp是企业管理计划 crm是客户关系管理 oa是办公自动化erp管理的是企业的进销存.产供销.财务等crm主要是管理企业的客户,可以和erp的销售系统挂钩oa主要是管理一些内部的文档.公告,行政信息 ...

  3. JavaScript绘制表格并将内容以JSON返回后台

    只是随手记一下 function printTable() { var aText = []; aText.push("<tr"); aText.push("&lt ...

  4. Pyhton爬虫实战 - 抓取BOSS直聘职位描述 和 数据清洗

    Pyhton爬虫实战 - 抓取BOSS直聘职位描述 和 数据清洗 零.致谢 感谢BOSS直聘相对权威的招聘信息,使本人有了这次比较有意思的研究之旅. 由于爬虫持续爬取 www.zhipin.com 网 ...

  5. 解决Chrome浏览器访问https提示&OpenCurlyDoubleQuote;您的连接不是私密连接”的问题

    安装fiddler后,使用Chrome访问https网站时,可能会出现以下错误,本文说明如何解决此类问题: “您的连接不是私密连接”.“NET::ERR_CERT_AUTHORITY_INVALID” ...

  6. CSS组合设计输入框和按钮生成自定义关键字查询栏

    效果图: html代码: <!DOCTYPE html> <head> <title></title> </head> <body&g ...

  7. sql语句修改字段约束为不为空 并为其设置主键

    alter table Drc_Project_Review alter column ReviewID uniqueidentifier not nullalter table Drc_Projec ...

  8. Linux修改终端显示前缀及环境变量

    Linux终端前面默认显示一长串,如: [work@aaa.baidu.com dir]$ 这是由PS1环境变量决定的: [work@aaa.baidu.com dir]$ echo $PS1 [\u ...

  9. &lbrack;leetcode&rsqb;Word Search &commat; Python

    原题地址:https://oj.leetcode.com/problems/word-search/ 题意: Given a 2D board and a word, find if the word ...

  10. NetCore偶尔有用篇:NetCore项目添加MIME

    一.简介 1.系统默认给我们提供的一些文件类型的处理方式. 2.系统没有为我们提供处理的文件类型无法使用,例如:apk 3.这里候就需要自己添加MIME,才能进行访问 4.下面就是添加apk访问的示例 ...