Ubuntu: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY

Error when adding repo to install kubectl

jonas@octo:~$ sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
Hit:1 http://jp.archive.ubuntu.com/ubuntu bionic InRelease
Get:2 https://nvidia.github.io/libnvidia-container/ubuntu18.04/amd64  InRelease [1,106 B]                                                                                                  
Get:3 https://nvidia.github.io/nvidia-container-runtime/ubuntu18.04/amd64  InRelease [1,103 B]                                                                                             
Hit:4 http://jp.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                                                                         
Hit:5 https://download.docker.com/linux/ubuntu bionic InRelease                                                                                                                            
Get:6 https://nvidia.github.io/nvidia-docker/ubuntu18.04/amd64  InRelease [1,096 B]                                                                                                        
Hit:7 http://jp.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                                                                       
Hit:9 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                                                                 
Get:8 https://packages.cloud.google.com/apt kubernetes-xenial InRelease [8,993 B]                                                                   
Err:8 https://packages.cloud.google.com/apt kubernetes-xenial InRelease                              
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
Hit:10 https://cf-cli-debian-repo.s3.amazonaws.com stable InRelease                             
Reading package lists… Done                                        
W: GPG error: https://packages.cloud.google.com/apt kubernetes-xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 6A030B21BA07F4FB
E: The repository 'http://apt.kubernetes.io kubernetes-xenial InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Solved by adding the missing key as follows

jonas@octo:~$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 6A030B21BA07F4FB

Executing: /tmp/apt-key-gpghome.JKpxFjtwsU/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 6A030B21BA07F4FB
gpg: key 6A030B21BA07F4FB: public key "Google Cloud Packages Automatic Signing Key <a href="mailto:gc-team@google.com">gc-team@google.com</a>" imported
gpg: Total number processed: 1
gpg:               imported: 1
jonas@octo:~$ 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.