Question

Trying to upgrade ubuntu 20.04lts to 22.04lts using do-release-upgrade, but getting public key errors

Currently 2 droplets to upgrade. both are:

  • Distributor ID: Ubuntu
  • Description: Ubuntu 20.04.6 LTS
  • Release: 20.04\
  • Codename: focal

Following the turotial: https://www.digitalocean.com/community/tutorials/how-to-upgrade-to-ubuntu-22-04-jammy-jellyfish

however I get the following errors (which appear to be signing error on DO reporitory) after running sudo do-release-upgrade:

*Err https://repos.insights.digitalocean.com/apt/do-agent main InRelease                                                            
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 77B79B3FFAF7EF65                
Err https://repos-droplet.digitalocean.com/apt/droplet-agent main InRelease                                                        
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 35696F43FC7DB4C2                
Fetched 11.0 kB in 0s (0 B/s)                                                                                                      

Error during update

A problem occurred during the update. This is usually some sort of network problem, please check your network connection and retry.

W:Updating from such a repository can't be done securely, and is 
therefore disabled by default., W:See apt-secure(8) manpage for 
repository creation and user configuration details., W:GPG error: 
https://repos.insights.digitalocean.com/apt/do-agent main InRelease: 
The following signatures couldn't be verified because the public key 
is not available: NO_PUBKEY 77B79B3FFAF7EF65, E:The repository 
'https://repos.insights.digitalocean.com/apt/do-agent main InRelease' 
is not signed., W:Updating from such a repository can't be done 
securely, and is therefore disabled by default., W:See apt-secure(8) 
manpage for repository creation and user configuration details., 
W:GPG error: https://repos-droplet.digitalocean.com/apt/droplet-agent 
main InRelease: The following signatures couldn't be verified because 
the public key is not available: NO_PUBKEY 35696F43FC7DB4C2, E:The 
repository 'https://repos-droplet.digitalocean.com/apt/droplet-agent 
main InRelease' is not signed. *

Any suggestions would be appreciated.

Paul


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.

KFSys
Site Moderator
Site Moderator badge
May 16, 2023

Hey @stonehousetraveller.

I’ve found a similar question in the community, here it is :

https://www.digitalocean.com/community/questions/how-to-fix-no_pubkey-77b79b3ffaf7ef65

Basically, what you need to do is add the missing keys:

  1. sudo apt-key adv --keyserver repos.insights.digitalocean.com/apt/do-agent --recv-keys 77B79B3FFAF7EF65
  2. sudo apt-key adv --keyserver repos-droplet.digitalocean.com/apt/droplet-agent --recv-keys 35696F43FC7DB4C2

If the above doesn’t work, try running:

  1. wget -qO - https://repos.insights.digitalocean.com/apt/do-agent | sudo apt-key add -
  2. wget -qO - https://repos.insights.digitalocean.com/apt/droplet-agent | sudo apt-key add -

Try DigitalOcean for free

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

Sign up

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

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

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

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