Ubuntu 16.04.1 apt-get update error

Posted November 4, 2016 30k views
FAQGetting StartedDigitalOceanUbuntu 16.04

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

Err:1 xenial-security InRelease
  Could not resolve ''
Err:2 xenial InRelease
  Could not resolve ''
Err:3 xenial-updates InRelease
  Could not resolve ''
Err:4 xenial-backports InRelease
  Could not resolve ''
Reading package lists... Done
W: Failed to fetch  Could not resolve ''
W: Failed to fetch  Could not resolve ''
W: Failed to fetch  Could not resolve ''
W: Failed to fetch  Could not resolve ''
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.

Submit an Answer
4 answers

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 (Ctrl+c will exit the ping command)

  • If the ping fails, check that you can ping an IP address, try (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 address as a nameserver by adding the line (if it doesn’t exist):


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

Correct nameserver in /etc/resolv.conf and ping works for and - However still struggling with

W: The repository ' xenial Release' does not have a Release file.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

on sudo apt-get update

If you run into this issue remember to check, amongst other things, that you have not configured UFW or the DO Cloud Firewall to block outgoing http/https. I had done this accidentally and only realized it when I tried to do apt-get install for something

Same problem as well. How can we solve this?