Question

Problems updating to Ubuntu 20.04.1

Posted October 21, 2020 915 views
Ubuntu 20.04

I am trying to update my Ubuntu 18.04.5 droplet to 20.04.1 without success. I have been using the console with the do-release-upgrade command (with or without the -d flag). It fails with a GPG error complaining that the signature is invalid. What do I need to do?

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
2 answers

I had this problem too and this is how i fixed it

Befor all don’t forget this two points :

– 1 – Do not reboot your PC until you finish all the steps

– 2 – Do not forget to update your grub befor rebooting by executing : sudo update-grub2

The problem here is that when you upgrade ubuntu from 18.04 to 20.04 the system did not replace every instance of bionic with focal : it did not replace libpython3.8-stdlib (3.8.2-1+bionic1) by libpython3.8-stdlib (= 3.8.2-1ubuntu1.1) So the solution is to replace it manually :) The steps to do this are :

1 - save the names of the packages that depend on the library in a text file to reinstall them later run : sudo apt-get autoremove libpython3.8-stdlib a message will show you all this packages :

(( apg apparmor apport apport-gtk …xserver-xorg-video-vmware xwayland yelp yelp-xsl ))

copy them in a text file, then tap “ yes ” to uninstall the bionic version of libpython3.8-stdlib

2- install the focal version by :

sudo apt-get install libpython3.8-stdlib
3- now install the packages saved in the text file one by one : you can create a screipt file like this : (( ....

sudo apt-get install gir1.2-gck-1
sudo apt-get install gir1.2-gcr-3
sudo apt-get install gir1.2-gdm-1.0
sudo apt-get install gir1.2-geoclue-2.0
sudo apt-get install gir1.2-gnomebluetooth-1.0
… ))

Do not forget to install the ubuntu-desktop if it is not in the package text file sudo apt-get install ubuntu-desktop

4- update your grub , run : sudo update-grub2

5- finally reboot your pc

That’s all :)

Hi,
I guess the upgrade process fails immediately after starting, when installer is checking existing repositories. There are two ways to fix this issue.

1. Importing missing public key.

The error message looks like

Output
GPG error: http://any.repository.org bionic InRelease:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1234567890ABCDEF

You can use the highlighted part of the message above (this string contains key ID) to import a public key.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 1234567890ABCDEF

You will get a bunch of lines like

Output
Executing: /tmp/apt-key-gpghome.qwe1223456/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 1234567890ABCDEF gpg: key 1234567890ABCDEF: public key "Any Repository" imported gpg: Total number processed: 1 gpg: imported: 1

That means that importing of a public key finished successfully.

2. Disabling the repository.

If the first method finishes unsuccessfully, you can try to disable problematic repository by commenting it on repository list. So, here is the error message again:

Output
GPG error: http://any.repository.org bionic InRelease:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1234567890ABCDEF

Use the highlighted part to find a file containing the repository.

sudo grep -e "http://any.repository.org" $(find /etc/apt/ -name "*.list")

You will get something like

Output
/etc/apt/sources.list.d/any.repository.list: deb http://any.repository.org bionic main /etc/apt/sources.list.d/any.repository.list:# deb-src http://any.repository.org bionic main

The highlighted string is a path/filename of list containing problematic repository. Open this list in your favorite text editor, and comment that repository with # sign. Save the file, exit the editor.

Let me know if it helps, please.

If you would like to find out more about secure apt, here is the link.

Submit an Answer