当前位置:   article > 正文

ubuntu20.04解决域名无法解析_ubuntu20.04换源后更新失败不能解析域名

ubuntu20.04换源后更新失败不能解析域名

在ubuntu20.04上使用apt update命令报错如下:

  1. Err:1 http://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.5.8.0/ubuntu18.04/amd64 ./ InRelease
  2. Temporary failure resolving 'linux.mellanox.com'
  3. Err:2 https://mirrors.aliyun.com/ubuntu focal InRelease
  4. Temporary failure resolving 'mirrors.aliyun.com'
  5. Err:3 https://mirrors.aliyun.com/ubuntu focal-security InRelease
  6. Temporary failure resolving 'mirrors.aliyun.com'
  7. Err:4 https://mirrors.aliyun.com/ubuntu focal-updates InRelease
  8. Temporary failure resolving 'mirrors.aliyun.com'
  9. Err:5 https://mirrors.aliyun.com/ubuntu focal-backports InRelease
  10. Temporary failure resolving 'mirrors.aliyun.com'
  11. Reading package lists... Done
  12. Building dependency tree
  13. Reading state information... Done
  14. All packages are up to date.
  15. W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal/InRelease Temporary failure resolving 'mirrors.aliyun.com'
  16. W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-security/InRelease Temporary failure resolving 'mirrors.aliyun.com'
  17. W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-updates/InRelease Temporary failure resolving 'mirrors.aliyun.com'
  18. W: Failed to fetch https://mirrors.aliyun.com/ubuntu/dists/focal-backports/InRelease Temporary failure resolving 'mirrors.aliyun.com'
  19. W: Failed to fetch http://linux.mellanox.com/public/repo/mlnx_ofed/5.1-2.5.8.0/ubuntu18.04/amd64/./InRelease Temporary failure resolving 'linux.mellanox.com'
  20. W: Some index files failed to download. They have been ignored, or old ones used instead.

初步判断是无法解析域名的问题,为解决这一问题,首先需要确保网络的连通性,使用ping 8.8.8.8命令测试网络连通性,然后使用以下命令配置DNS服务器

vi /etc/resolv.conf

然后输入

nameserver 8.8.8.8

nameserver 8.8.4.4

退出保存,然后发现apt update可以运行成功了。

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/528846
推荐阅读
相关标签
  

闽ICP备14008679号