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.
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.
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.
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./etc/apt/apt.conf.d/ and in the system network settings, and remove ones that are not yours anymore.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.
The video tests a failing update, separates the DNS failure from the mirror timeout, and finishes the update on a healthy mirror.
▶️ Watch Full VideoIn 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.
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.
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.