Technical Anshu
Tutorials Blog
🐧 Ubuntu Mirror Fix

Slow or Failed Ubuntu Mirror Change It and Fix Name Resolution

Sometimes every repository is healthy and the road to them is not. This page separates the two network failures apt reports - names that will not resolve, and a mirror that resolves but crawls - because each has its own short fix.

✍️ Technical Anshu🐧 Ubuntu / Linux⏱️ 6 minute read
🎥 Watch the full video - the apt-get update fix shown live, step by step

No repository file is wrong, no key is missing, no lock is held - yet sudo apt update still fails, because the packets never arrive. The clues are phrases like "Temporary failure resolving" and "Connection timed out". This page shows how to tell a DNS failure from a sick mirror, fix each one properly, and recognise when the real problem is your connection rather than Ubuntu's servers.

Terminal - two different network failures, two different fixes
$ sudo apt update Err:1 http://archive.ubuntu.com/ubuntu jammy InRelease Temporary failure resolving 'archive.ubuntu.com' Err:2 http://in.archive.ubuntu.com/ubuntu jammy-updates InRelease Connection timed out [IP: 103.147.8.10 80]
Temporary failure resolving means your PC could not translate the server name at all - a DNS or connection problem. Connection timed out means the name resolved but that mirror is slow or down. Addresses shown are examples.
1

Two Failures That Look Alike but Are Not

When the address itself is fine but the network path is not, apt fails in two distinct ways and the wording separates them. "Temporary failure resolving 'archive.ubuntu.com'" means your PC could not even turn the server's name into a number - nothing was contacted. That is a local DNS or connection problem. "Connection timed out" or repeated "Failed to fetch" on one mirror means the name resolved, the server was reached for, and it is slow, overloaded or down. That is a mirror problem. Treating one as the other wastes an hour: changing mirrors never fixes DNS, and fixing DNS never speeds up a dying mirror.

2

If Names Will Not Resolve - Test DNS First

  1. Test name resolution directly: getent hosts archive.ubuntu.com. It should print a line with numbers (the server's addresses). Nothing printed means resolution is broken on your PC.
  2. Check the basics honestly: is the machine actually online - does a browser open any page? Wi-Fi connected to a router with no internet behind it produces exactly this error.
  3. Restart the connection (toggle Wi-Fi or reconnect the cable) and test again. Routers and laptops both occasionally lose their DNS settings in ways a reconnect quietly repairs.
  4. If only apt fails to resolve while the browser works, a proxy setting is a likely suspect - an old office proxy stored in apt's or the system's settings points every apt request at a server that no longer answers. Look for proxy entries under /etc/apt/apt.conf.d/ and in the system network settings, and remove ones that are not yours anymore.
3

If the Mirror Is Slow or Down - Change It

True
4

Do Not Chase Mirrors Forever

One honest boundary: if updates fail at home but work elsewhere, or fail on every mirror at the same hour daily, the mirror is not the story - your connection or a filtering router is. Repeatedly swapping mirrors to outrun a bad line produces confusion, not speed. Pick one healthy official mirror, keep it, and spend remaining effort on the connection itself. And never solve this by pointing apt at an unofficial mirror you found on a forum: the whole signature system assumes official infrastructure, and a stranger's mirror is a stranger handling your software supply.

🔴 One firm rule: only ever use official Ubuntu mirrors. A mirror recommended by a stranger may be fast for the worst reason. The Select Best Server tool inside Ubuntu tests the genuine mirror list - that convenience exists precisely so you never need anyone else's list.

🎥 Watch the Complete Video for Full Knowledge and Installation

The video tests a failing update, separates the DNS failure from the mirror timeout, and finishes the update on a healthy mirror.

▶️ Watch Full Video
❓ Common Questions (FAQ)

What does Select Best Server actually do?

In Software and Updates, Select Best Server contacts the official Ubuntu mirrors in the list and measures which responds fastest from your connection, then offers that mirror as your Download from choice. It changes only which official server you download the same signed packages from - your release, sources and installed software are unaffected, and you can switch back at any time.

The browser works but apt still says Temporary failure resolving. Why?

Because apt can be told to use a proxy that your browser does not use. Old proxy settings - often left behind from an office or college network - are stored in apt configuration files under /etc/apt/apt.conf.d/ or in the system network settings, and apt faithfully asks that dead proxy to resolve every name. Removing the stale proxy entry restores normal resolution immediately.

How long should I wait before deciding a mirror is really down?

A single timeout can be a busy minute on a healthy mirror. Run sudo apt update once more after a short pause. If the same mirror times out or fails to fetch repeatedly across two or three tries while other sites load normally, treat it as a mirror problem and switch. Official mirrors carry identical packages, so switching costs nothing and needs no loyalty.

This guide is based on the Technical Anshu video on the Ubuntu mirror and DNS failures in apt • Stuck on a step? Ask in the video comments - answers live there 🙏