I get error when apt-get update how to resolve this problem?

March 20, 2018 307 views
Linux Basics Linux Commands Ubuntu 16.04

Err http://security.ubuntu.com trusty-security InRelease

Err http://security.ubuntu.com trusty-security Release.gpg
Could not resolve 'security.ubuntu.com'
Err http://mz.archive.ubuntu.com trusty InRelease

Err http://mz.archive.ubuntu.com trusty-updates InRelease

Err http://mz.archive.ubuntu.com trusty-backports InRelease

Err http://mz.archive.ubuntu.com trusty Release.gpg
Could not resolve 'mz.archive.ubuntu.com'
Err http://mz.archive.ubuntu.com trusty-updates Release.gpg
Could not resolve 'mz.archive.ubuntu.com'
Err http://mz.archive.ubuntu.com trusty-backports Release.gpg
Could not resolve 'mz.archive.ubuntu.com'
Reading package lists... Done
W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty/InRelease

W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty-updates/InRelease

W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty-backports/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/InRelease

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/trusty-security/Release.gpg Could not resolve 'security.ubuntu.com'

W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty/Release.gpg Could not resolve 'mz.archive.ubuntu.com'

W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty-updates/Release.gpg Could not resolve 'mz.archive.ubuntu.com'

W: Failed to fetch http://mz.archive.ubuntu.com/ubuntu/dists/trusty-backports/Release.gpg Could not resolve 'mz.archive.ubuntu.com'

W: Some index files failed to download. They have been ignored, or old ones used instead.

1 Answer

It looks like your Droplet is having trouble looking up domain names, possibly because the DNS resolvers are misconfigured. Can you post the output of these two commands?

cat /etc/resolv.conf
sudo netstat -plutn | grep :53
  • cat /etc/resolv.conf
    root@ubuntu:/home/jorge# cat /etc/resolv.conf

    # Dynamic resolv.conf(5) file for glibc resolver(3) generated by resolvconf(8)

    DO NOT EDIT THIS FILE BY HAND -- YOUR CHANGES WILL BE OVERWRITTEN

    nameserver 8.8.8.8

    netstat -plutn | grep :53
    root@ubuntu:/home/jorge# netstat -plutn | grep :53
    tcp 0 0 192.168.109.140:53 0.0.0.0:* LISTEN 1190/named
    tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 1190/named
    tcp6 0 0 :::53 :::* LISTEN 1190/named
    udp 0 0 192.168.109.140:53 0.0.0.0:* 1190/named
    udp 0 0 127.0.0.1:53 0.0.0.0:* 1190/named
    udp6 0 0 :::53 :::* 1190/named

    • Hmm, that looks fine. Your server should be using the name servers configured in /etc/resolv.conf. I found this post that is a bit old but I doubt that much has changed since then. Does that help?

Have another answer? Share your knowledge.