"us.archive.ubuntu.com: no server could be reached" after upgrading to Ubuntu 20.04

Solution 1:

I followed the instruction on this link and it helped me to overcome "no server could be reached" error and finally update and upgrade my Ubuntu

https://linuxconfig.org/temporary-failure-resolving-error-on-ubuntu-20-04-focal-fossa-linux

Here are the steps that I copied from the link in case you are like me and having hard time finding the issue.:

step 1: check your internet connection:

$ ping -c 2 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=54 time=10.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=54 time=10.2 ms

--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 10.157/10.291/10.425/0.134 ms

you should see 0% packet loss

step 2: check your DNS configuration by running the following command:

$ systemd-resolve --status | grep Current
      Current Scopes: DNS
  Current DNS Server: 192.168.1.1

You should see the DNS Server for your system in this case DNS server is 192.168.1.1

step 3 Check if you can reach your DNS server using ping (remember to change the server name 192.168.1.1 to your DNS server from previous step).

$ ping -c 2 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=0.535 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=0.570 ms

--- 192.168.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1016ms
rtt min/avg/max/mdev = 0.535/0.552/0.570/0.017 ms

the output of the command should result in 0% packet loss

step 4: Test you DNS server by attempting to resolve DNS name eg. linuxconfig.org with dig command:

$ dig @192.168.1.1 linuxconfig.org

; <<>> DiG 9.11.5-P4-5.1ubuntu4-Ubuntu <<>> @192.168.1.1 linuxconfig.org
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21662
;; flags: qr rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 4096
;; QUESTION SECTION:
;linuxconfig.org.       IN  A

;; ANSWER SECTION:
linuxconfig.org.    300 IN  A   104.26.3.13
linuxconfig.org.    300 IN  A   104.26.2.13

;; Query time: 408 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Wed Dec 11 14:02:07 AEDT 2019
;; MSG SIZE  rcvd: 76

After going through the above steps ( again full credit is given to the provided link) I was able to update my Ubuntu through sudo apt update and then sudo apt upgrade without any error and be able to get Ubuntu 20.04.2 up and running again.

Hope this helps you and save you some time and it took me almost two days to figure this out.