release: Expired key - "Google Cloud Packages Automatic Signing Key"
The current available key expired yesterday:
dcaro@vulcanus$ gpg --list-key 6A030B21BA07F4FB
pub rsa2048 2018-04-01 [SCE] [expired: 2021-03-31]
54A647F9048D5688D7DA2ABE6A030B21BA07F4FB
uid [ expired] Google Cloud Packages Automatic Signing Key <gc-team@google.com>
What happened: The key used to sign all the packages from the packages.cloud.google.com repos https://packages.cloud.google.com/apt/dists/debian-buster-mirror/Release.gpg has expired.
What you expected to happen: The key to be refreshed đ
How to reproduce it (as minimally and precisely as possible):
Please provide links to example occurrences, if any: This is a new occurrence of kubernetes/test-infra#7505
Anything else we need to know?: Thanks for all the good work!
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 13
- Comments: 69 (25 by maintainers)
Commits related to this issue
- Disable GPG check untill issue is fixed https://github.com/kubernetes/release/issues/1982 — committed to grycap/ansible-role-kubernetes by micafer 2 years ago
- Fix permissions for Kubernetes GPG key See: https://github.com/kubernetes/release/issues/1982#issuecomment-1159254570 — committed to vexxhost/docker-openstack-runtime by mnaser 2 years ago
Just copy paste into terminal
sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpgecho "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.listAlright, so to correctly set this up for debian Iâd suggest the following then:
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | gpg --dearmor | sudo dd status=none of=/usr/share/keyrings/kubernetes-archive-keyring.gpgecho "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.listsudo apt updateRunning the command from @mrajadurai2413 seems to work for my machine and solved the issues for missing public key for Kubernetes.
System: Ubuntu 20.04 Focal Fossa Kubernetes Version: 1.26
Error Message:
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. 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 B53DC80D13EDEF05 W: Failed to fetch https://apt.kubernetes.io/dists/kubernetes-xenial/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY B53DC80D13EDEF05 W: Some index files failed to download. They have been ignored, or old ones used instead.Original commands from @mrajadurai2413 to import the public GPG keys for Kubernetes from Google:
sudo curl -fsSLo /etc/apt/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpgecho "deb [signed-by=/etc/apt/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.listAfter running the first set of commands, run commands below to update and review the gpg keys:
sudo apt update && sudo apt upgradesudo apt-get update && sudo apt-get upgradeSame as https://github.com/kubernetes/test-infra/issues/7505#issuecomment-378045292
There was a new key pushed, it may be all you need to do is update to use the new signing key
Something like this should work?
or
Having said that, the appropriate team internally is currently fielding a number of issues. I believe the new key may not have fully rolled out yet. If the above doesnât work for you, please report back.
I will share a command that worked for me in Ubuntu 18.04
Source Known Issues Google Cloud
So, I tried to follow a simple instruction on how to install kubernetes using native package management for Debian-based distributions (my os version is
Ubuntu 20.04) and get some of the errors mentioned above. To be precise,apt updateoutput this lines:As were mentioned #1982 (comment), I tried to remove
signed-bypart (but in/etc/apt/sources.list.d/kubernetes.list) and added one of the missing key withapt-keyand it worked. To summarize, the solution in my case was to change a little be the instruction mentioned above:sudo apt-get update && sudo apt-get install -y apt-transport-https ca-certificates curlecho "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.listsudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 8B57C5C2836F4BEBsudo apt-get update && sudo apt-get install -y kubectl@RakhithaRR can you confirm that something like this works for you, or maybe provide an isolated reproducer:
This is still broken for people on at least CentOS 7. I dont think the priority should be downgraded. I dont know what the exact solution would be, but I dont think disabling a gpg check is the permanent solution.
I have the same version of Ubuntu as @narensrini-ds and the following commands has been working for me. The correct path for me is /usr/share/keyrings/kubernetes-archive-keyring.gpg
Thank you so much @narensrini-ds and @afolarin
OK. This was killing me for a while. I have to do this on Ubuntu 20.04
Try before this
I see a similar issue in Ubuntu 20.04.
apt-get updateshows this errorRunning the above two commands youâve mentioned did not solve this. I can still see that
Google Cloud Packages Automatic Signing Keyis expired (on 2021-03-31) when I runapt-key list.@contributorpw already answered it and shared perfect workaround for me here: curl https://packages.cloud.google.com/apt/doc/apt-key.gpg -o /usr/share/keyrings/cloud.google.gpg
(the answer above with hearts on it, go add one if it works for you!)
/etc/apt/keyrings/kubernetes-archive-keyring.gpgor/usr/share/keyrings/kubernetes-archive-keyring.gpgwhich is correct?
/sig release /priority critical-urgent
@jsoref looks like I stand corrected - the documentation I linked wasnât the clearest.
https://wiki.debian.org/DebianRepository/UseThirdParty
Same issue on my machine while
apt update/remove-priority critical-urgent /priority important-longterm
Downgrading priority. If we donât hear back from the author of this issue I would recommend we close unless anyone has any concrete follow ups they want to hold open for.
It depends on your definition.
The second one assumes youâre the os vendor/distributor, which you probably arenât.
The first one assumes youâre the owner of the machine.
Workaround to get apt-get update working
apt-get update
Obviously, you shouldn't trust the contents of a random person
Search for keys: https://keyserver.ubuntu.com/pks/lookup?search=0xFEEA9169307EA071&fingerprint=on&op=index Retrieve: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x7f92e05b31093bef5a3c2d38feea9169307ea071
Search for keys: https://keyserver.ubuntu.com/pks/lookup?search=0x8B57C5C2836F4BEB&fingerprint=on&op=index Retrieve: https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x59fe0256827269dc81578f928b57c5c2836f4beb
The first key is the expired key, I donât remember its index, but itâs expired, so unless your clock is wrong, it wonât be trusted, and Google isnât signing with it, so it still wonât matter.
https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired should probably be shared somewhere (perhaps the kubernetes.io install docs?) but I donât think thereâs anything else further to do here.
The keys have been updated, yum continues to have problematic behavior here but the workaround is published in the link above.
If you read the latest version of the man page, instead of expecting the upstream to backport deprecation messages to the version youâre using, youâll see that the tool youâre using is deprecated: https://manpages.debian.org/experimental/apt/apt-key.8.en.html
Technically a given version of a platform will generally support (to some limited definition of support) the tools it had when it shipped. Thatâs generally a promise not to break functionality in it. Practically, that means you can still use a given program, even if itâs a bad idea to do so.
What it doesnât mean and isnât a license to do is to tell others how they should work in the general case.
In the general case, you shouldnât use that program as itâs deprecated because itâs fundamentally broken.
I thinktrusted.gpgis not recommended due to global trust of keys under that keyring by apt opening a security issue. But it is now recommended to use separate keyrings undertrusted.gpg.dSee
https://itsfoss.com/apt-key-deprecated/
ed. donât use
/etc/apt/trusted.gpg.duse/usr/share/keyringsTo make this work under Debian 5.10.162-1 I adjusted the keyring directories:1.sudo curl -fsSLo /etc/apt/trusted.gpg.d/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg2.echo "deb [signed-by=/etc/apt/trusted.gpg.d/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list3.sudo apt updateSeems this is outdated, see below for the correct way of doing this.
https://cloud.google.com/compute/docs/troubleshooting/known-issues#ubuntu-systems
this works for me
Another reason for getting NO_PUBKEY on
apt-get updateis when the GPG key file is not world-readable - easy to end up like this by accident with tightumaskdefaults. And if you are wondering (as I was) why it needs to be world-readable even when apt runs as root - it is because apt switches to_aptuser for many operations that donât require privilege (see here).A simple
chmod o+r <keyfile>fixes NO_PUBKEY in this particular case.Folks, the Kubernetes project does not manage these keys, nor does the team that voluntarily continues to publish these packages until the project moves to community infrastructure. https://github.com/kubernetes/release/issues/913 seems to be the current tracking issue for this.
per https://cloud.google.com/compute/docs/troubleshooting/known-issues#keyexpired the recommendation is to disable GPG repo (not package) check in RPM.
Yep, this seems to be working for me:
Note that I had to use
/etc/apt/trusted.gpg.d/k8s-apt-key.gpgand not/etc/apt/trusted.gpg/k8s-apt-key.gpg. The folder/etc/apt/trusted.gpgdidnât exist on my system. This is part of a larger bash script that installs K8s on fresh systems.The problem with just adding the key is that youâll still get this: https://github.com/kubernetes/release/issues/1982#issuecomment-826582877
because the odds are tat your repository has pinned the key:
Someone (possibly me) needs to file a bug (and possibly a patch) to apt to change the error message:
Everyone else just needs to either edit the
/etc/apt/sources.list.d/google-cloud-sdk.listfile to change thesigned-byfield (or remove it), or replace the contents of that file w/ the updated valueIf at all possible, someone from google should provide a way to upgrade that file.