Facing authentication failed while upgrading to 20.04

$ sudo do-release-upgrade -d 
Checking for a new Ubuntu release
Get:1 Upgrade tool signature [1,554 B]                                                                                                 
Get:2 Upgrade tool [1,342 kB]                                                                                                          
Fetched 1,343 kB in 6s (84.2 kB/s)                                                                                                     
authenticate 'focal.tar.gz' against 'focal.tar.gz.gpg' 
Authentication failed
Authenticating the upgrade failed. There may be a problem with the network or with the server. 

FYI: I already tried sudo apt-get install --reinstall ubuntu-keyring. I have also tried to change the server to "Main Server" still it does not work for me.


Solution 1:

I'm not sure the accepted answer should be recommended because I imagine the normal upgrade process does plenty of other things?

I had the same problem like the original poster and found out it was a missing (not logged) gpg key. For information my installed system is really old was updated through the years from a 13.10 installation so I guess that's why there were some public key problems.

First I checked the two files with apt-key verify focal.tar.gz.gpg focal.tar.gz

Which showed me that there was a key missing to check the signature.

In case you don't have this files in your tmp folder you can just download them and make the verification:

http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz http://archive.ubuntu.com/ubuntu/dists/focal-updates/main/dist-upgrader-all/current/focal.tar.gz.gpg

gpgv: Signature made jeu. 03 sept. 2020 15:23:39 CEST
gpgv:                using RSA key 3B4FE6ACC0B21F32
gpgv: Good signature from "Ubuntu Archive Automatic Signing Key (2012) [email protected]"
gpgv: Signature made jeu. 03 sept. 2020 15:23:39 CEST
gpgv:                using RSA key 871920D1991BC93C
gpgv: Can't check signature: No public key

I then added the missing public key via: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93C

The update was functioning properly afterwards.

Solution 2:

Now I'm able to upgrade to ubuntu 20.04 after replacing below contents in /etc/apt/sources.list

deb http://in.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse

deb http://in.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse

deb http://in.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb http://in.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://in.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse

deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner