centos6.5 yum update 报错Couldn't resolve host 'centos.ustc.edu.cn'
异常信息
[root@localhost ~]# yum -y update
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Update Process
Loading mirror speeds from cached hostfile
* base: centos.ustc.edu.cn
* extras: ftp.sjtu.edu.cn
* updates: centos.ustc.edu.cn
http://centos.ustc.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'centos.ustc.edu.cn'"
Trying other mirror.
http://ftp.sjtu.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'ftp.sjtu.edu.cn'"
Trying other mirror.
http://mirror.bit.edu.cn/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirror.bit.edu.cn'"
Trying other mirror.
http://mirrors.163.com/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.163.com'"
Trying other mirror.
http://mirrors.aliyun.com/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.aliyun.com'"
Trying other mirror.
http://mirrors.cn99.com/centos/6.8/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "Couldn't resolve host 'mirrors.cn99.com'"
Trying other mirror. ..... sssd-krb5-common-1.13.3-22.el6_8.6.x86_64: failure: Packages/sssd-krb5-common-1.13.3-22.el6_8.6.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
nss-tools-3.21.3-2.el6_8.x86_64: failure: Packages/nss-tools-3.21.3-2.el6_8.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
iscsi-initiator-utils-6.2.0.873-22.el6_8.x86_64: failure: Packages/iscsi-initiator-utils-6.2.0.873-22.el6_8.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
db4-4.7.25-20.el6_8.1.x86_64: failure: Packages/db4-4.7.25-20.el6_8.1.x86_64.rpm from updates: [Errno 256] No more mirrors to try.
1.服务器解析不了域名, ping mirrors.ustc.edu.cn 这个地址,发现 unknown host mirrors.ustc.edu.cn,ping www.baidu.com同样不行
[root@localhost ~]# ping mirrors.ustc.edu.cn
ping: unknown host mirrors.ustc.edu.cn
2.查看 /etc/resolv.conf 文件,发现没有设置域名服务
[root@localhost ~]# cat /etc/resolv.conf
# Generated by NetworkManager # No nameservers found; try putting DNS servers into your
# ifcfg files in /etc/sysconfig/network-scripts like so:
#
# DNS1=xxx.xxx.xxx.xxx
# DNS2=xxx.xxx.xxx.xxx
# DOMAIN=lab.foo.com bar.foo.com
search localhost
3.查看网络配置文件,发现没有配置默认网关
[root@localhost ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
IPADDR=192.168.200.105
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=eth0
3.查看当前网关信息,发现默认网关不对
[root@localhost ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
link-local * 255.255.0.0 U 1002 0 0 eth0
192.0.0.0 * 255.0.0.0 U 0 0 0 eth0
4.添加默认网关(虚拟机选择桥接模式配置下面信息)
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0 #网卡名称
#HWADDR=00:0C:29:3B:A3:99 MAC地址可以不写(与 /etc/udev/rules.d/70-persistent-net.rules 文件中的 ATTR{address}值一致就行)
TYPE=Ethernet #网络类型(通常是Ethemet)
UUID=3259a85a-c34c-4ecf-98e8-e1fe495c899f #随机数,唯一标识
ONBOOT=yes #设置为yes,开机自动启用网络连接
NM_CONTROLLED=yes #network mamager的参数 ,是否可以由NNetwork Manager托管
BOOTPROTO=static #设置为none禁止DHCP,设置为static启用静态IP地址,设置为dhcp开启DHCP服务
DNS1=192.168.200.1 #DNS 配置
IPV6INIT=no #是否启用IPv6的接口
USERCTL=no #是否允许非root用户控制该设备,设置为no,只能用root用户更改
IPADDR=192.168.200.200 #指定静态ip地址
NETMASK=255.255.255.0 #子网掩码
GATEWAY=192.168.200.1 #默认网关
windows查看网关
控制面板 -->网络和Internet -->网络和共享中心 -->本地连接 -->详细信息
如图
5.重启网络
service network restart
centos6.5 yum update 报错Couldn't resolve host 'centos.ustc.edu.cn'的更多相关文章
- yum命令报错 yum update File "/usr/bin/yum", line 30 except KeyboardInterrupt, e: --CentOS7.5
1.问题: 使用yum命令如:yum update 报SyntaxError invalid syntax 2.原因分析 yum的解释器是Python,CentOS自带的yum采用(自带的)pytho ...
- centos6.5环境wget报错Unable to establish SSL connection
centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...
- linux -小记(2)问题:yum 安装报错"Another app is currently holding the yum lock; waiting for it to exit... ...: yum Memory : 26 M RSS (868 MB VSZ) Started: Wed Oct 26 22:48:24 2016 - 0"
yum 安装报错 "Another app is currently holding the yum lock; waiting for it to exit... The other ap ...
- mysql执行update报错1175解决方法
mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...
- yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between
yum安装报错有冲突file /usr/lib64/php/modules/fileinfo.so conflicts between attempted installs of php-pecl-f ...
- centos在yum install报错:Another app is currently holding the yum lock解决方法
centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚 ...
- mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY
mysql执行update报错 Err] 1055 - 'information_schema.PROFILING.SEQ' isn't in GROUP BY 今天开发的同事发来如下错误信息,最最简 ...
- kali linux 2.0配置更新源后apt-get update 报错
这个是我/etc/apt/sources.list的更新源: deb http://http.kali.org/kali kali-rolling main contrib non-free deb ...
- CentOS6.5 重启网络报错:Bringing up interface eth0: Error: Connection activation failed: Device not managed by NetworkManager or unavailable
CentOS6.5 重启网络报错: Bringing up interface eth0: Error: Connection activation failed: Device not manage ...
随机推荐
- tornado的非异步阻塞模式
[优化tornado阻塞任务的三个选择] 1.优化阻塞的任务,使其执行时间更快.经常由于是一个DB的慢查询,或者复杂的上层模板导致的,这个时候首要的是加速这些任务,而不是优化复杂的webserver. ...
- RunLoop想入门,看这篇就够了
前言 刚刚听到RunLoop的时候我也是一脸懵逼,这是什么,有什么用呢,逼格貌似还挺高.然后就开始尝试去搞懂它,去找博客,但是几乎所有的博客都是枯燥乏味的,都是讲概念,然后给个实例,对于我这个小白来说 ...
- source is null for getProperty(null, "cpmodel")异常结局
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.builder.BuilderExce ...
- shiro入门示例
一.pom引入maven依赖 <dependencies> <dependency> <groupId>junit</groupId> <arti ...
- canvas动画之动态绘出六边形
先上 demo: http://en.jsrun.net/W5iKp/show 这两天我一直在研究这个动画,花了大量的时间来想是如何实现的, 一开始我是想在进入 canvas 时按时间来用 lineT ...
- Animation-list,帧动画+属性动画,做出Flash般的效果
我们会用到PS,即使不会也不要怂,只需要几步傻瓜式操作即可. 属性动画可以看看我另一篇文章:属性动画详解 效果图 相信机智的各位,看完之后一定能发挥创意,做出更酷更炫的效果 图层获取 首先你需要找一张 ...
- 安卓开源框架SlidingMenu使用
在安卓开发中,会使用很多的开源框架,这篇博文讲的是SlidingMenu--侧边栏 SlidingMenu的是一种比较新的设置界面或配置界面效果,在主界面左滑或者右滑出现设置界面, 能方便的进行各种操 ...
- python并发编程之多线程一
一,什么是线程 线程也被称为轻量进程计算机科学术语,指运行中的程序的调度单位. 线程是进程中的实体,一个进程可以拥有多个线程,一个线程必须有一个父进程.线程不拥有系统资源,只有运行必须的一些数据结构: ...
- Spring Cloud Feign 整合 Hystrix
在前面随笔Spring Cloud 之 Feign的feign工程基础上进行改造 1.pom.xml依赖不变 2.application.yml文件添加feign.hystrix.enabled=tr ...
- pku 1330 Nearest Common Ancestors LCA离线
pku 1330 Nearest Common Ancestors 题目链接: http://poj.org/problem?id=1330 题目大意: 给定一棵树的边关系,注意是有向边,因为这个WA ...