Ubuntu18.04 sudo apt update无法解析域名的解决,亲测有效!

 错误:


   
   
  1. 错误: 1 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu bionic InRelease
  2. 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  3. 错误: 2 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-updates InRelease
  4. 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  5. 错误: 3 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-backports InRelease
  6. 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  7. 错误: 4 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-security InRelease
  8. 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  9. 错误: 5 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu bionic-proposed InRelease
  10. 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  11. 正在读取软件包列表... 完成
  12. 正在分析软件包的依赖关系树
  13. 正在读取状态信息... 完成
  14. 所有软件包均为最新。
  15. W: 无法下载 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic/InRelease 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  16. W: 无法下载 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-updates/InRelease 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  17. W: 无法下载 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-backports/InRelease 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  18. W: 无法下载 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-security/InRelease 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  19. W: 无法下载 https: //mirrors.tuna.tsinghua.edu.cn/ubuntu/dists/bionic-proposed/InRelease 无法解析域名“mirrors.tuna.tsinghua.edu.cn”
  20. W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

 

解决:


   
   
  1. 1. sudo vim /etc/resolv.conf # 添加如下内容
  2. nameserver 8.8 .8 .8
  3. nameserver 127.0 .0 .1
  4. options edns0
  5. 2. 输入Esc,:wq,保存并退出
  6. 3. sudo /etc/init.d/networking restart
  • 2
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 3
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值