Yum install GPG error

When using yum install, sometimes the old GPG keys installed with rpm are obsolete, resulting in an error like the following:

warning: rpmts_HdrFromFdno: Header V3 DSA signature: NOKEY, key ID db42a60e public key not available for autoconf-2.59-5.noarch.rpm Retrieving GPG key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora The GPG key at file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora (0x4F2A6FD2) is already installed but is not the correct key for this package. Check that this is the correct key for the "Fedora Core 4 - i386 - Base" repository.

To fix, just add the new keys to rpm (changing the path for you particular install):

rpm --import /etc/pki/rpm-gpg/RPM*

Some forum posts have suggested disabling GPG (i.e. gpgcheck=0), which can be a foolish thing to do. You want to maintain some level of assurance that what you're downloading is legit.