AWS Linux2 Image can't verify repository signatures

I've been using this image for testing, and for almost every app I've faced this issue, today it's with kubectl. While trying to install it, yum says:

    Retrieving key from https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
kubernetes/signature                                                                                                                                                                                                  | 1.4 kB  00:00:00 !!!
https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64/repodata/repomd.xml: [Errno -1] repomd.xml signature could not be verified for kubernetes
Trying other mirror.

Tried other mirrors, but same result. I'll keep trying, would like to make it work without going to binaries and also know why this happens so often.

Thanks!


Redhat/Fedora/Centos make use of GPG package signing to ensure that package integrity has not been compromised and to check if the software package comes from authorized sources.

You can import a key into RPM's database by hand using the following command:

rpm --import PUBKEY ...

A remedy for your issue can be to import actual GPG keys from Kubernetes vendor:

 rpm --import https://packages.cloud.google.com/yum/doc/yum-key.gpg

 rpm --import https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg