Error during upgrade Ubuntu 18.04 to 22.04

Hi - Following upgrade instructions at

When doing

sudo apt update

I get following GPGerror:

Hit:1 bionic InRelease
Hit:2 bionic-security InRelease
Hit:3 bionic InRelease
Hit:4 trusty-infra-security InRelease
Hit:5 trusty-infra-updates InRelease
Hit:6 main InRelease
Hit:7 bionic InRelease
Hit:8 bionic-updates InRelease
Hit:9 bionic-backports InRelease
Ign:10 stable InRelease
Hit:11 stable Release
Err:12 stable Release.gpg
  The following signatures were invalid: EXPKEYSIG 78BD65473CB3BD13 Google Inc. (Linu  x Packages Signing Authority) <>
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
W: An error occurred during the signature verification. The repository is not updated   and the previous index files will be used. GPG error:  -pagespeed/deb stable Release: The following signatures were invalid: EXPKEYSIG 78BD6  5473CB3BD13 Google Inc. (Linux Packages Signing Authority) <linux-packages-keymaster@>
W: Failed to fetch  gpg  The following signatures were invalid: EXPKEYSIG 78BD65473CB3BD13 Google Inc. (L  inux Packages Signing Authority) <>
W: Some index files failed to download. They have been ignored, or old ones used inst  ead.

Any idea how to fix this before proceeding ??


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

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.

Bobby Iliev
Site Moderator
Site Moderator badge
February 10, 2023

Hi there,

What you could try doing is to remove the repository that is causing the problem and then once you are ready, you could re-add the correct repository again for the new Ubuntu version.

You could do that in two ways:

  • Find the file containing the repo definition:
grep -r mod-pagespeed /etc/apt/*
  • Open the file with your favourite text editor and comment out the mod-pagespeed lines by adding a # in the beginning of the line

  • Alternatively, you can use the add-apt-repository, the command should look something like this:

sudo add-apt-repository "deb [arch=amd64] stable main"

Then update the package index: sudo apt update.

And finally, rerun the upgrade. After the upgrade is complete, you could re-add the repo as normal.

Make sure to always back up your Droplet when doing such major upgrades.

Let me know how it goes!



Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel