Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

Fix "Temporary failure resolving archive.ubuntu.com"

This error shows up when your Ubuntu server cannot find the update server. The cause is almost always a DNS problem. You need root access for this guide.

Dedicated Servers2 min read9 steps

What does the error mean?

DNS is like a phone book for the internet. It turns a name such as archive.ubuntu.com into a number that computers understand. When you run apt update, your server looks up that name. If the phone book is not reachable, you get "Temporary failure resolving".

Steps

  1. Log in to your server over SSH.
  2. Check that the internet itself works. Ping a public number address.
ping -c 3 8.8.8.8

This sends three small test messages. If you get replies, the connection is fine and DNS is the problem. If not, the network is down. Open a ticket with Hostvento support.

  1. Now test a name.
ping -c 3 archive.ubuntu.com

If this fails while the first one worked, DNS is broken.

  1. Look at your DNS settings file.
cat /etc/resolv.conf

This prints the list of DNS servers. It should have at least one line starting with nameserver.

  1. Back up the file with cp /etc/resolv.conf /etc/resolv.conf.bak.
  2. Open it with nano /etc/resolv.conf.
  3. Add these lines. They are free public DNS servers run by Google and Cloudflare, not by Hostvento.
nameserver 8.8.8.8
nameserver 1.1.1.1
  1. Save the file.
  2. Run apt update again.

If the fix does not last

On newer Ubuntu, a service called systemd-resolved may rewrite /etc/resolv.conf. Your edit then disappears after a restart. Check its state with this command.

systemctl status systemd-resolved

This shows if the service is running. Set the DNS in the network settings file under /etc/netplan/ instead. Add a nameservers: block with addresses: [8.8.8.8, 1.1.1.1], then run netplan apply. Be careful with spacing, because the file is picky. Back it up first.

Tip: Your server may have DNS servers given by the data center. Hostvento support can tell you which ones to use.

Quick recap

  • The error means DNS cannot turn the name into a number.
  • Test ping to 8.8.8.8 first, then to the name.
  • Add working nameserver lines to /etc/resolv.conf.
  • Use netplan if the file keeps resetting.