xuyuan8
By:
xuyuan8

Ubuntu 16.04.1 apt-get update error

November 4, 2016 236 views
DigitalOcean FAQ Getting Started Ubuntu 16.04

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

Err:1 http://security.ubuntu.com/ubuntu xenial-security InRelease
  Could not resolve 'security.ubuntu.com'
Err:2 http://mirrors.digitalocean.com/ubuntu xenial InRelease
  Could not resolve 'mirrors.digitalocean.com'
Err:3 http://mirrors.digitalocean.com/ubuntu xenial-updates InRelease
  Could not resolve 'mirrors.digitalocean.com'
Err:4 http://mirrors.digitalocean.com/ubuntu xenial-backports InRelease
  Could not resolve 'mirrors.digitalocean.com'
Reading package lists... Done
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial/InRelease  Could not resolve 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-updates/InRelease  Could not resolve 'mirrors.digitalocean.com'
W: Failed to fetch http://mirrors.digitalocean.com/ubuntu/dists/xenial-backports/InRelease  Could not resolve 'mirrors.digitalocean.com'
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Could not resolve 'security.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
1 Answer

The errors shown indicate that there is a network or DNS issue here. Have you changed the DNS servers listed in /etc/resolv.conf?

I would take the following steps to troubleshoot this:

  • Check that you can reach other outside services. Try a ping of security.ubuntu.com (Ctrl+c will exit the ping command)

  • If the ping fails, check that you can ping an IP address, try 8.8.8.8 (Google public DNS server)

  • If the IP address ping fails, open a ticket with our support team as there may be an issue with your droplet's network connection (especially if you are doing this from the console).

  • If that ping works, check the file /etc/resolv.conf and use that 8.8.8.8 address as a nameserver by adding the line (if it doesn't exist):

nameserver 8.8.8.8

I hope these steps help you to find a solution. If you get it resolved, let us know what worked.

Have another answer? Share your knowledge.