$ dnf list grafana
Last metadata expiration check: 0:01:16 ago on Tue 22 Nov 2022 06:27:39 PM MST.
Available Packages
grafana.aarch64 9.3.0~beta1-1 grafana
grafana.armhfp 9.3.0~beta1-1 grafana
grafana.x86_64 9.3.0~beta1-1 grafana
See the repo file in the question. The exclude parameter is used as instructed. The issue remains. Unable to update automatically, contrary to the docs.
[root@localhost ~]# dnf install grafana-9.2.6-1.x86_64
Last metadata expiration check: 0:17:57 ago on Thu 24 Nov 2022 11:48:37 AM CET.
Dependencies resolved.
===================================================================================================================================================================================================================
Package Architecture Version Repository Size
===================================================================================================================================================================================================================
Installing:
grafana x86_64 9.2.6-1 grafana 92 M
This way the user can install the latest stable release.
For this workaround, I think you’ll also want to disable the Grafana repo so that you don’t get pushed to beta when you run dnf update for normal CentOS updates.
$ sudo dnf install grafana-9.2.6-1.x86_64
Last metadata expiration check: 0:00:44 ago on Thu 24 Nov 2022 10:51:28 AM MST.
Dependencies resolved.
========================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================
Installing:
grafana x86_64 9.2.6-1 grafana 92 M
Installing dependencies:
chkconfig x86_64 1.20-2.el9 baseos 162 k
Transaction Summary
========================================================================================================================
Install 2 Packages
Total size: 92 M
Installed size: 309 M
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] grafana-9.2.6-1.x86_64.rpm: Already downloaded
[SKIPPED] chkconfig-1.20-2.el9.x86_64.rpm: Already downloaded
grafana 9.4 kB/s | 1.7 kB 00:00
Importing GPG key 0x24098CB6:
Userid : "Grafana <info@grafana.com>"
Fingerprint: 4E40 DDF6 D76E 284A 4A67 80E4 8C8C 34C5 2409 8CB6
From : https://rpm.grafana.com/gpg.key
Is this ok [y/N]: y
Key import failed (code 2). Failing package is: grafana-9.2.6-1.x86_64
GPG Keys are configured as: https://rpm.grafana.com/gpg.key
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Error: GPG check FAILED
Seems like there is an update to the original GitHub bug as I do not see the beta packages anymore but that may had to break the GPG keys I also tested it out and got the same problem as you have shown.
WORKAROUND
Step1
sett gpgcheck=0 in the .repo file (/etc/yum.repos.d/grafana.repo)
Step 2
then clean the package manager cache
dnf clean all and dnf clean metadata
Step 3
Build new cache
dnf makecache
Step 4
dnf install grafana
Install the grafana and this time it will not give the GPG key error