异常信息

[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'的更多相关文章

  1. 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 ...

  2. centos6.5环境wget报错Unable to establish SSL connection

    centos6.5环境wget报错Unable to establish SSL connection [root@centossz008 src]# wget --no-check-certific ...

  3. 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 ...

  4. mysql执行update报错1175解决方法

    mysql执行update报错 update library set status=true where 1=1 Error Code: 1175. You are using safe update ...

  5. 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 ...

  6. centos在yum install报错:Another app is currently holding the yum lock解决方法

    centos在yum install报错:Another app is currently holding the yum lock,这个问题可能是很多的新手经常遇到问题,之前也有人问我,包括本人在刚 ...

  7. 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 今天开发的同事发来如下错误信息,最最简 ...

  8. kali linux 2.0配置更新源后apt-get update 报错

    这个是我/etc/apt/sources.list的更新源: deb http://http.kali.org/kali kali-rolling main contrib non-free deb ...

  9. 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 ...

随机推荐

  1. Gmail,QMail,163邮箱的 IMAP/SMTP/POP3 地址

    我们在客户端设置邮箱或者使用 PHPMailer 发送邮件的时候,我们都会去查找这些邮箱的 IMAP/SMTP/POP3 地址,这里就列出 Gmail, QMail, 163邮箱这三个常用邮箱的这些地 ...

  2. PHP和java比较

    这样从几个方面来看:一.运行机制:Java代码被编译成字节码后,会在虚拟机里由JIT进行二次编译成为本地码,据传言其执行速度可以和C++相媲美,经过我自己测试,用Java实现一个简单的Memcache ...

  3. linux操作系统基础篇(一)

    1.什么是linux? Linux是一套免费使用和自由传播的类Unix操作系统,是一个基于POSIX和UNIX的多用户.多任务.支持多线程和多CPU的操作系统.它能运行主要的UNIX工具软件.应用程序 ...

  4. RabbitMQ之路由

    为了实现一个新功能:只订阅消息的一个子集,例如只需要把严重的错误日志信息写入日志文件(存储到磁盘上),但同时仍然把所有的日志信息输出到控制台中. 绑定(Bindings) 创建绑定 channel.q ...

  5. 电商SEO

    大家都知道网站有SEO,电商也有SEO,今天陈晨就带大家来讲讲电商SEO的思路以及电商最重要的选品规划! 1. 选品是核心 2. 挖掘卖点是你走向成功必经之路 3. 产品定价策略---人群画像 4. ...

  6. PHP编辑器PhpStrom运行缓慢问题

    最近在使用phpstorm开发项目的时候,在加载文件运行时,不管有多大,如果项目文件数据比较多的话,都能够让phpstorm卡到死机.其中调整过内存设置,关闭过动态提示,使用过phpstorm的安全模 ...

  7. vim操作命令

    一,命令模式下 文件顶部: gg 文件底部: G 删除当前行:dd 删除当前行,并进入INSERT模式: cc 取消删除:u

  8. numpy中关于*和dot的区别

    1.numpy乘法运算中"*"是数组元素逐个计算 >>> import numpy as np >>> a = np.array([[2,3], ...

  9. WampSever 安装问题解析

    鉴于有些电脑安装wampsever出现的几种问题 [1] 2.2版本问题 这里端口配置正确,本地服务器没有开启(也就是80端口没有占用) 还是出现这种情况 也就是Apache service 和 PH ...

  10. 【tyvj P4868】天天和不可描述

    http://www.tyvj.cn/p/4868 超级水的题,用递归来模拟,用链表保存这层的内容,每遇到一个左括号就递归一层并合并返回的链表,遇到右括号后返回. 递归进入下一层时传递个参数标记读取新 ...