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
Edit /etc/dnf/dnf.conf and set gpgcheck=1 in the [main] section. Example
[main]
gpgcheck=1
Edit any failing files in /etc/yum.repos.d/* and set all instances starting with gpgcheck to 1
Example:
# find /etc/yum.repos.d/ -name "*.repo" -exec echo "Checking:" {} \; -exec sed -i 's/^gpgcheck\s*=\s*.*/gpgcheck=1/' {} \;