How To Solve MySQL GPG Key Errors During yum update

I went to perform a yum update and got the following error:
1 2 3 4 5 6 7 |
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql The GPG keys listed for the "MySQL 5.7 Community Server" repository are already installed but they are not correct for this package. Check that the correct key URLs are configured for this repository. Failing package is: mysql-community-server-5.7.37-1.el7.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql |
SOLUTION: Import the needed new key and manually edit the config files before retrying the yum update.
1 |
rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022 |
I had to edit two files: mysql-community-source.repo and mysql-community.repo
1 |
vi /etc/yum.repos.d/my* |
For 5.7 – add -2022 to the key name: i.e.: ORIGINAL:
1 |
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-mysql |
MODIFY ONE […]