Question

Signatures couldn't be verified because public key not available

Hi all,

When I run sudo apt update, I get the following:

 The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
Fetched 278 kB in 2s (167 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://repo.mysql.com/apt/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Failed to fetch http://repo.mysql.com/apt/ubuntu/dists/focal/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B7B3B788A8D3785C
W: Some index files failed to download. They have been ignored, or old ones used instead.

I tried what was suggested in this community post to no avail. Does anyone have any other suggestions?


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
March 14, 2024
Accepted Answer

Heya,

The error you’re encountering indicates that the APT package manager is unable to verify the GPG signature of the MySQL repository because it lacks the necessary public key. This usually happens when a repository is added but its corresponding GPG key is not imported. To resolve this, you need to add the missing public key. The key ID B7B3B788A8D3785C is provided in your error message.

Let’s try another approach from the one in the post you mentioned:

Add the Repository Key:

Open a terminal.

Execute the following command to import the key:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B7B3B788A8D3785C

This command tells apt-key to retrieve the key from a keyserver and add it to your system.

Update the Package Lists:

After importing the key, update the package lists:

sudo apt update

This will refresh the list of available packages and incorporate the changes made by adding the new key.

If for some reason, the apt-key adv command does not work (which can happen in certain environments or due to network issues), you can try an alternative method:

Add the Key Using an Alternative Method:

You can download the key and add it manually. Run:

sudo gpg --keyserver keyserver.ubuntu.com --recv B7B3B788A8D3785C
sudo gpg --export --armor B7B3B788A8D3785C | sudo apt-key add -

Then Update the Package Lists again.

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