[SOLVED] Grafana repository error NO_PUBKEY

In case you see this error in your logs when you update your openhabian and/or linux distro:

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packagecloud.io/grafana/stable/debian stretch InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40F370A1F9081B64
W: Failed to fetch https://packagecloud.io/grafana/stable/debian/dists/stretch/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40F370A1F9081B64
W: Some index files failed to download. They have been ignored, or old ones used instead.

the solution I’ve found is to reconfigure grafana repository using the original script:

curl -s https://packagecloud.io/install/repositories/grafana/stable/script.deb.sh | sudo bash

then remove the duplicate in /etc/apt/sources.list.d named “grafana_stable.list” as you should already have the previous grafana.list.

Perform a sudo apt-get update and the error will disappear.

Hope this helps

Andrea

3 Likes