Information
The gpgcheck option controls verifying package signatures after download. This option is configurable as a global option in the main section of /etc/dnf/dnf.conf and a per repository option in individual files in the /etc/yum.repos.d/* directory.
The option is enabled if gpgcheck is set to 1, true, or yes . The option is disabled if gpgcheck is set to 0, false, or no . If an invalid option is set, e.g. gpgcheck=2, the global option will be used.
Settings in files in the /etc/yum.repos.d/ directory take precedence over the global configuration.
It is important to ensure that an RPM's package signature is always checked prior to installation to ensure that the software is obtained from a trusted source.
Solution
Set gpgcheck=1 in the [main] section of /etc/dnf/dnf.conf :
[main]
gpgcheck=1
Ensure no repository overrides this with gpgcheck=0 . In any repository definition file under /etc/yum.repos.d (or another configured reposdir directory) that sets gpgcheck=0, change it to gpgcheck=1 (or remove the line so the repository inherits the global setting).