Score:3

NO_PUBKEY error after the key was successfully added

fr flag

When I run sudo apt-get update a get the following error:

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 B53DC80D13EDEF05

I can't rid off this error no matter what I try.

The ways I've tried to resolve the issue:

1. Adding key manually

I've googled how to solve the error and it seems that everybody recommends to add missing public key via apt-key:

$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv B53DC80D13EDEF05
Executing: /tmp/apt-key-gpghome.MRlBtkNXHX/gpg.1.sh --keyserver keyserver.ubuntu.com --recv B53DC80D13EDEF05
gpg: key B53DC80D13EDEF05: 1 duplicate signature removed
gpg: key B53DC80D13EDEF05: "Rapture Automatic Signing Key (cloud-rapture-signing-key-2022-03-07-08_01_01.pub)" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

After executing the commands above, the NO_PUBKEY error persist.

2. Removing repository

I've looked through the list of repositories in /etc/apt/sources.list and /etc/apt/sources.list.d and I've found /etc/apt/sources.list.d/google-cloud-sdk.list:

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

I've deleted the file via sudo rm -rf /etc/apt/sources.list.d/google-cloud-sdk.list, but I still get the same error.

Score:3
cz flag

In my case nothing worked until I simply used --dearmor to make gpg binary instead of ASCII when downloading the updated key.

curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg| gpg -o /usr/share/keyrings/kubernetes-archive-keyring.gpg --dearmor

apt-get update worked after that without errors

Score:0
sa flag
  1. Add Kubernetes signing key.

    On each server node, use the curl command to download the key, then store it in a safe place (default is /usr/share/keyrings):

    curl -fsSL https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo tee /usr/share/keyrings/kubernetes.gpg
    
  2. Add software repositories.

    Kubernetes is not included in the default repositories. To add the Kubernetes repository to your list, enter the following on each node:

    echo "deb [arch=amd64 signed-by=/usr/share/keyrings/kubernetes.gpg] http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list
    
  3. Kubernetes installation tools

    Kubeadm (Kubernetes Admin) is a tool that helps initialize a cluster. It fast-tracks setup by using community-sourced best practices. Kubelet is the work package, which runs on every node and starts containers. The tool gives you command-line access to clusters.

    Execute the following commands (on each server node).

    • Install Kubernetes tools with the command:

       sudo apt install kubeadm kubelet kubectl
      

      Set Kubernetes tools on hold:

       sudo apt-mark hold kubeadm kubelet kubectl
      
    • Verify the installation with kubeadm version

source: How to Install Kubernetes on Ubuntu 20.04

basil-knab avatar
fr flag
What do you mean by "On each node" in the very first step of your answer? I get this error not on my k8s nodes of my k8s cluster, but on my personal machine.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.