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
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock32 error was14: 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 onlysafe 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.在终端中输入以下命令,查看安装在本机的网卡:

|
1
2
3
4
5
6
|
[xi@localhost ~]$ nmcli d//以下显示是已经配置到网络后的本机网络状况。DEVICE TYPE STATE CONNECTION virbr0 bridge connected virbr0 eno16777736 ethernet connected eno16777736virbr0-nic ethernet disconnected -- lo loopback unmanaged -- |
2.GUI 或 命令模式的网络配置:
GUI模式:
Step #1 » 在终端中输入以下命令,打开网络管理员。接着选择“Edit a connection”后按回车键(使用TAB键进行选择的选项)。
|
1
|
[xi@localhost ~]$ nmtui |

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

Step 3 » 动态配置 或 静态配置
» 动态配置
1.在“IPv4 CONFIGURATION”配置选择“<Automatic>”;
2.选择“Automatically connect”复选框;
3.点击OK键,退出网络管理器。最后,通过键入以下命令重新启动网络服务。
|
1
|
[xi@localhost ~]$ systemctl restart network |
现在你的服务器将从DHCP获得IP地址。

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

现在你的服务器具有静态IP。
命令模式:
Step #1 » 切换到/etc/sysconfig/network-scripts/目录下,打开“ifcfg-eno16777736”文件:
|
1
|
xi@localhost network-scripts]$ cd /etc/sysconfig/network-scripts/ |

|
1
|
[xi@localhost network-scripts]$ vim ifcfg-eno16777736 |
打开ifcfg-eno16777736文件,展开如下:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
1 TYPE=Ethernet2 BOOTPROTO=none3 DEFROUTE=yes4 IPV4_FAILURE_FATAL=no5 IPV6INIT=yes6 IPV6_AUTOCONF=yes7 IPV6_DEFROUTE=yes8 IPV6_FAILURE_FATAL=no9 NAME=enp0s1710 UUID=7f1aff2d-b154-4436-9497-e3a4dedddcef11 ONBOOT=no12 HWADDR=00:0C:29:A1:B5:D613 PEERDNS=yes14 PEERROUTES=yes15 IPV6_PEERDNS=yes16 IPV6_PEERROUTES=yes |
Step #3 » 动态配置 或 静态配置
» 动态配置
依次将第2行和第11行替换为:
BOOTPROTO=dhcp
ONBOOT=yes
然后,通过键入以下命令重新启动网络服务:
|
1
|
[xi@localhost ~]$ systemctl restart network |
连接外网,测试网络是否成功:
|
1
|
xi@localhost ~]$ ping www.baidu.com |
» 静态配置
依次将第2行和第11行替换为:
BOOTPROTO=static
ONBOOT=yes
然后,在文件末尾添加以下4行:
|
1
2
3
4
|
IPADDR=172.27.0.32NETMASK=255.255.255.0GATEWAY=172.27.0.1DNS1=172.27.0.5 |
最后,通过键入以下命令重新启动网络服务:
|
1
|
[xi@localhost ~]$ systemctl restart network |
现在你的服务器具有静态IP。
此外,你可以通过打开文件/ etc / sysconfig / network来修改主机名和DNS。
centos查询本机的外网输入 curl ifconfig.me 命令即可查看:

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

|
1
2
3
4
|
HOSTNAME = server.krizna.comDNS1 = 192.168.1.5DNS2 = 8.8. 8.8SEARCH = krizna.com |
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报错: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 7后,在Terminal中运行yum安装命令时报了以下错误: Could not retrieve mirrorlist http://mirrorlist.cen ...
- yum 安装报错: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; Unknown error"
[root@venn09 ~]# yum install -y vim Loaded plugins: fastestmirror Could not retrieve mirrorlist http ...
- Bug Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stock error was
yum -y install gcc 时候报bug: Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7& ...
- Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=stoc
今天在使用yum安装文件时,出现了以下问题: root@localhost opt]# yum update Loaded plugins: fastestmirror Could not retri ...
- Linux安装yum install gcc-c++出错: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...
错误如图: 解决办法: 1.修改配置文件 /etc/resolv.conf,该配置文件如下: 2.输入:gedit resolv.conf,修改配置文件内容如下: 3.然后重启: 4.重新进行安装: ...
- 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误"
14: curl#6 - "Could not resolve host: mirrorlist.centos.org; 未知的错误" One of the configured ...
- yum安装软件报错:curl#6 - "Could not resolve host: mirrorlist.centos.org; Temporary failure in name resolut
# yum install -y epel-release Loaded plugins: fastestmirror Repository base is listed more than once ...
- 安装时遇到:正在尝试其它镜像。 http://mirrors.btte.net/centos/7.2.1511/extras/x86_64/repodata/repomd.xml: [Errno 14] curl#6 - "Could not resolve host: mirrors.btte.net; 未知的错误"
我出现这种错误是因为网络链接问题,因为我设置虚拟机网络链接为VmNET8,设置了nat模式,使得我本地机可以访问虚拟机的linux服务器.但是打开虚拟机的浏览器却不能上网了.所以现在我用xshell装 ...
- Could not resolve host: mirrorlist.centos.org Centos 7 Unkown error
安装Centos7(core)以后,网卡默认不会启用.这是一个大坑,直接报错,这是一个过度优化,有几个开发人员/运维人员安装centos7(core)不用ssh去连接服务器的. 报错如下: Loade ...
随机推荐
- Python的线程池
#!/usr/bin/env python # -*- coding: utf-8 -*- """ concurrent 用于线程池和进程池编程而且更加容易,在Pytho ...
- 从零开始搭建一个规范的vue-cli 3.0项目
在这一集我们将讲到如何从安装vue-cli开始,到新建一个本地项目,再到vscode中关于eslint的配置,以及本地项目关联公司远程项目的基本操作. 一,初始化本地项目 1,首先,全局安装vue-c ...
- 解读经典《C#高级编程》继承 页107-113.章4
前言 本章节开始讲接口. 接口 接口的声明很像抽象类,有方法的声明但无方法体.但它比抽象类限制更多.和类比起来,接口的定义有众多限制. 接口只能包含声明,而无方法体 接口只能包含方法.属性.索引器.事 ...
- WebForm+一般处理程序+Ajax聊天
#### 很容易理解 插入数据 到数据库 在使用 setInterval() 读取数据 显示在 页面中 好了 不废话 直接上代码 不会的 可以加我 微信 Jth11163## 效果图片 ![在这里插入 ...
- ajax的嵌套需要注意的问题
当我们要嵌套ajax的时候,需要注意 异步/同步 的处理,一般是要设置成同步,如果是异步,那么被嵌套的ajax的操作很可能获取不到想要的值,因为他可能比嵌套他的ajax跑的更早 在ajax中有一个as ...
- 封装继承多态(OOP)
封装:把事物封装成类,私有化属性. 继承:共同的特性封装在父类,子类就有父类的属性 父类已经实现了的方法,子类也有需要前面+New 隐藏父类的方法,就不报错了,有这个语法,面试的时候问过,不推荐用. ...
- 基础概念PHP-FPM、FastCGI和CGI
在搭建 LAMP/LNMP 服务器时,会经常遇到 PHP-FPM.FastCGI和CGI 这几个概念.如果对它们一知半解,很难搭建出高性能的服务器.接下来我们就以图形方式,解释这些概念之间的关系. 基 ...
- php去除数组中重复值,并返回结果!
array_unique(array) 只能处理value只有单个的数组. 去除有多个value数组,可以使用如下函数实现: function more_array_unique($arr=array ...
- SuperMap iObject入门开发系列之一组件式GIS开发平台介绍
本文是一位好友“炀炀”授权给我来发表的,介绍都是他的研究成果,在此,非常感谢.平台介绍:SuperMap iObjects Java/.NET 是面向GIS应用系统开发者的组件式GIS开发平台,具有强 ...
- Python 基于pykafka简单实现KAFKA消费者
基于pykafka简单实现KAFKA消费者 By: 授客 QQ:1033553122 1.测试环境 python 3.4 zookeeper-3.4.13.tar.gz 下载地址1 ...