快捷导航

ubuntu apt无法更新,提示无法解析域名,但域名可以ping通。

root@ubuntu:/etc# sudo apt-get update错误:1 http://mirrors.yun-idc.com/ubuntu bionic InRelease  暂时不能解析域名“mirrors.yun-idc.com”错误:2 http://mirrors.yun-idc.com/ubuntu bionic-security InRelease  暂时不能解析域名“mirrors.yun-idc.com”错误:3 http://mirrors.yun-idc.com/ubuntu bionic-updates InRelease  暂时不能解析域名“mirrors.yun-idc.com”错误:4 http://mirrors.yun-idc.com/ubuntu bionic-backports InRelease  暂时不能解析域名“mirrors.yun-idc.com”错误:5 http://mirrors.yun-idc.com/ubuntu bionic-proposed InRelease  暂时不能解析域名“mirrors.yun-idc.com”正在读取软件包列表... 完成W: 无法下载 http://mirrors.yun-idc.com/ubuntu/dists/bionic/InRelease  暂时不能解析域名“mirrors.yun-idc.com”W: 无法下载 http://mirrors.yun-idc.com/ubuntu/dists/bionic-security/InRelease  暂时不能解析域名“mirrors.yun-idc.com”W: 无法下载 http://mirrors.yun-idc.com/ubuntu/dists/bionic-updates/InRelease  暂时不能解析域名“mirrors.yun-idc.com”W: 无法下载 http://mirrors.yun-idc.com/ubuntu/dists/bionic-backports/InRelease  暂时不能解析域名“mirrors.yun-idc.com”W: 无法下载 http://mirrors.yun-idc.com/ubuntu/dists/bionic-proposed/InRelease  暂时不能解析域名“mirrors.yun-idc.com”W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。root@ubuntu:/etc# vi /etc/hostsroot@ubuntu:/etc# cat /etc/resolv.conf nameserver 223.5.5.5 root@ubuntu:/etc# ping 223.5.5.5PING 223.5.5.5 (223.5.5.5) 56(84) bytes of data.64 bytes from 223.5.5.5: icmp_seq=1 ttl=52 time=72.4 ms64 bytes from 223.5.5.5: icmp_seq=2 ttl=52 time=76.8 ms64 bytes from 223.5.5.5: icmp_seq=3 ttl=52 time=77.9 ms64 bytes from 223.5.5.5: icmp_seq=4 ttl=52 time=69.4 ms64 bytes from 223.5.5.5: icmp_seq=5 ttl=52 time=77.4 ms64 bytes from 223.5.5.5: icmp_seq=6 ttl=52 time=49.4 ms64 bytes from 223.5.5.5: icmp_seq=7 ttl=52 time=48.4 ms^C--- 223.5.5.5 ping statistics ---7 packets transmitted, 7 received, 0% packet loss, time 6017msrtt min/avg/max/mdev = 48.486/67.435/77.980/12.017 msroot@ubuntu:/etc# ping mirrors.yun-idc.comPING mirrors.yun-idc.com (114.112.43.174) 56(84) bytes of data.64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=1 ttl=53 time=19.1 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=2 ttl=53 time=19.1 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=3 ttl=53 time=19.2 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=4 ttl=53 time=19.0 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=5 ttl=53 time=19.0 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=6 ttl=53 time=19.3 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=7 ttl=53 time=19.1 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=8 ttl=53 time=21.1 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=9 ttl=53 time=19.1 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=10 ttl=53 time=18.7 ms64 bytes from 114.112.43.174 (114.112.43.174): icmp_seq=11 ttl=53 time=19.2 ms

免责声明:本内容仅代表回答者见解不代表本站观点,请谨慎对待。

版权声明:作者保留权利,不代表本站立场。

回复

使用道具 举报

参与会员1

编辑
vi/etc/resolv.conf添加一行
nameserver你的域名保存后重启网络服务

servicenetworkrestart
回复

使用道具 举报

可能感兴趣的问答

发新帖
  • 微信访问
  • 手机APP