NO_PUBKEY error in google cloud debian packages update

I have a couple of Google Clouds compute instances (US, Germany, Australia)

While doing

apt-get update 

today I get:

> Get:10 http://packages.cloud.google.com/apt
> google-cloud-packages-archive-keyring-stretch InRelease [3,876 B]
> Err:6 http://packages.cloud.google.com/apt cloud-sdk-stretch InRelease
>   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB 
> Err:7 http://packages.cloud.google.com/apt google-compute-engine-stretch-stable InRelease   
>   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB 
> Err:10 http://packages.cloud.google.com/apt google-cloud-packages-archive-keyring-stretch InRelease   
>   The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB

On all of them. Is there anything I need to do, or is this a corruption on Google packages?

Thanks

Yves


Solution 1:

If you followed the guide here: https://cloud.google.com/sdk/docs/install#deb and used the signed-by option, then you need to provide apt-key with the --keyring option:

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

Solution 2:

Found the issue here: https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired

So you just need to run this before to apt-get update:

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