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 ...
随机推荐
- eclipse使用jrebel
注:以下都是网上收集整理的,可能不全,仅限于学习和研究使用. JavaRebel是一个工具,主要是用于热加载,比如说在Tomcat之类的应用服务器中,更新了class或者某些资源文件,使用了JRebe ...
- python学习总结笔记(一)
1.raw_input("请输入:")提示录入信息,读取录入的字符串返回你录入的字符串2.os.environ 获取所有系统的环境变量,返回一个字典.3.str与repr区别str ...
- Entity Framework Core 使用HiLo生成主键
#cnblogs_post_body.cnblogs-markdown p img { max-width: 95%; } HiLo是在NHiernate中生成主键的一种方式,不过现在我们可以在Ent ...
- JavaWeb 学习之 JSTL
上一篇博文我们讲解了 MVC 小案例,案例中包含了基本的增.删.改.查,对这个案例的有兴趣的伙伴可以自己动手实践一下,去复习一下或者说是学点新的知识!如果有已经看过且实践过的伙伴相信对 JSP 页面中 ...
- windows配置caffe + python和matlab接口
参考: http://blog.csdn.net/baidu_26408419/article/details/53711640 http://www.cnblogs.com/love6tao/p/5 ...
- C#对SQLite、Access数据库操作的封装,很好用的~
1.对SQLite的封装: using System; using System.Collections.Generic; using System.Linq; using System.Text; ...
- android stdio 快捷键
俗话说工欲善其事必先利其器,先熟悉快捷键是很有必要的 IDE 按键 ...
- java第一阶段测试
一.选择题(35题 * 2分)1. 下列代码编译和运行的结果是:C public static void main(String[] args) { String[] elements = { & ...
- MySQL学习——基本命令(1)
MySQL添加新用户.为用户创建数据库.为新用户分配权限 参考博客http://blog.csdn.net/u013216667/article/details/70158452 一.登录MySQL ...
- [安全]服务器安全之 PHP权限目录
1.为每个主机配置增加一个 fastcgi_param PHP_VALUE "open_basedir=$document_root:/tmp/"; 或是直接把这句话放到fa ...