Fix :apt-get update fails to fetch files, “Temporary failure resolving …” error

 

Fix :apt-get update fails to fetch files, “Temporary failure resolving …” error

overview

There are two parts to your question:

  • fixing temporary resolve messages
  • fixing the package management issues

Temporary resolve

It is likely that this issue is either:

  • temporary due to your Internet Service Provider not correctly forwarding internet naming (DNS) to either its or external DNS servers, or
  • due to a change in your network has similarly blocked this naming - for example, new router/modem, reconfiguring a switch with a new configuration.

Lets look at the possible DNS resolving issues.

First, temporarily add a known DNS server to your system.

echo "nameserver 8.8.8.8" | sudo tee /etc/resolv.conf > /dev/null

Then run sudo apt-get update.

If this fixes your temporary resolving messages then either wait for 24 hours to see if your ISP fixes the issue for you (or just contact your ISP) - or you can permanently add a DNS server to your system:

echo "nameserver 8.8.8.8" | sudo tee /etc/resolvconf/resolv.conf.d/base > /dev/null

8.8.8.8 is Google's own DNS server.

Nhận xét