美文网首页
ubuntu系统中执行sudo apt-get update报错

ubuntu系统中执行sudo apt-get update报错

作者: 等等ChEnH | 来源:发表于2019-11-17 11:44 被阅读0次

    ubuntu系统中执行sudo apt-get update报错如下:

    Err:1 http://security.ubuntu.com/ubuntu disco-security InRelease
    Temporary failure resolving 'security.ubuntu.com'
    Err:2 http://cn.archive.ubuntu.com/ubuntu disco InRelease
    Temporary failure resolving 'cn.archive.ubuntu.com'
    Err:3 http://cn.archive.ubuntu.com/ubuntu disco-updates InRelease
    Temporary failure resolving 'cn.archive.ubuntu.com'
    Err:4 http://cn.archive.ubuntu.com/ubuntu disco-backports InRelease
    Temporary failure resolving 'cn.archive.ubuntu.com'
    Reading package lists... Done
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/disco/InRelease Temporary failure resolving 'cn.archive.ubuntu.com'
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/disco-updates/InRelease Temporary failure resolving 'cn.archive.ubuntu.com'
    W: Failed to fetch http://cn.archive.ubuntu.com/ubuntu/dists/disco-backports/InRelease Temporary failure resolving 'cn.archive.ubuntu.com'
    W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/disco-security/InRelease Temporary failure resolving 'security.ubuntu.com'
    W: Some index files failed to download. They have been ignored, or old ones used instead.

    问题在于DNS没有配置好,执行命令

    sudo vi /etc/resolv.conf 
    

    #新添加begin
    nameserver 8.8.8.8
    nameserver 8.8.4.4
    #新添加end
    nameserver 127.0.0.53
    options edns0

    Esc取消编辑模式,:wq!保存编辑退出,执行cat命令查看是否编辑成功

    sudo cat /etc/resolv.conf 
    

    之后执行sudo apt-get update就正常了。

    相关文章

      网友评论

          本文标题:ubuntu系统中执行sudo apt-get update报错

          本文链接:https://www.haomeiwen.com/subject/palpictx.html