The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB

Solution 1:

Per Installing Google Cloud SDK  |  Cloud SDK Documentation - Debian/Ubuntu:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

OR

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

follow by:

sudo apt-get update

Solution 2:

curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key --keyring /usr/share/keyrings/cloud.google.gpg add -

Solution 3:

The accepted answer didn't work for me.

Eventually I noticed that to install the google sdk I used the following, copied directly from the google documentation:

echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main" | sudo tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
sudo apt-get install apt-transport-https ca-certificates gnupg
sudo apt-get update && sudo apt-get install google-cloud-sdk

Eventually I noticed that /etc/apt/sources.list.d/google-cloud-sdk.list had a reference to a gpg file, which I thought might be the offending "NO_PUBKEY 6A030B21BA07F4FB" mismatch:

deb [signed-by=/usr/share/keyrings/cloud.google.gpg] https://packages.cloud.google.com/apt cloud-sdk main

When I went to open the gpg file (/usr/share/keyrings/cloud.google.gpg) it didn't exist. So I edited google-cloud-sdk.list to remove the reference:

deb https://packages.cloud.google.com/apt cloud-sdk main

And after that, I was able to update with apt-get update without issue.

Slightly off topic - fixing previous google sdk install

Then I remembered that installed the google sdk and kubectl using snap, because I got an error, and I hoped this might fix it. The installer suggested snap when it couldn't find the proper repositories.

My original install commands:

snap install google-cloud-sdk --classic
snap install google-cloud-sdk --classic

So, I removed the snap versions and installed the regular versions.

snap remove google-cloud-sdk
snap remove kubectl
sudo apt-get install kubectl
sudo apt-get install google-cloud-sdk