Question

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

Posted March 20, 2018 24.9k views
Linux BasicsLinux CommandsUbuntu 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.

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

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

Hi,
I had same issue and tried many given solution but nothing worked.
It was a issue with the domains. Some files does not exists. So I replace the us repositories.

Please referrer to https://gist.github.com/h0bbel/4b28ede18d65c3527b11b12fa36aa8d1

Submit an Answer