我是靠谱客的博主 有魅力柠檬,最近开发中收集的这篇文章主要介绍apt-get update 域名无法解析,觉得挺不错的,现在分享给大家,希望可以做个参考。

概述

执行apt-get update出错:

root@dbserver1:/etc/apt/sources.list.d# apt-get update
错误:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  暂时不能解析域名“security.ubuntu.com”
错误:2 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu xenial InRelease
  暂时不能解析域名“ppa.launchpad.net”
错误:3 http://cn.archive.ubuntu.com/ubuntu xenial InRelease
  暂时不能解析域名“cn.archive.ubuntu.com”
错误:4 http://cn.archive.ubuntu.com/ubuntu xenial-updates InRelease
  暂时不能解析域名“cn.archive.ubuntu.com”
错误:5 http://cn.archive.ubuntu.com/ubuntu xenial-backports InRelease
  暂时不能解析域名“cn.archive.ubuntu.com”
正在读取软件包列表... 完成
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  暂时不能解析域名“cn.archive.ubuntu.com”
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  暂时不能解析域名“cn.archive.ubuntu.com”
W: 无法下载 http://cn.archive.ubuntu.com/ubuntu/dists/xenial-backports/InRelease  暂时不能解析域名“cn.archive.ubuntu.com”
W: 无法下载 http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  暂时不能解析域名“security.ubuntu.com”
W: 无法下载 http://ppa.launchpad.net/jonathonf/python-3.6/ubuntu/dists/xenial/InRelease  暂时不能解析域名“ppa.launchpad.net”
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

 

解决方法:

这时候会发现ping www.baidu.com也ping不通,说明dns有问题。

修改dns:

sudo vi /etc/resolvconf/resolv.conf.d/base(这个文件默认是空的)

在里面插入:
nameserver 8.8.8.8

如果有多个DNS就一行一个

 

修改好保存,然后使其生效

sudo resolvconf -u

最后

以上就是有魅力柠檬为你收集整理的apt-get update 域名无法解析的全部内容,希望文章能够帮你解决apt-get update 域名无法解析所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(63)

评论列表共有 0 条评论

立即
投稿
返回
顶部