最近想装docker,先更新了一下yum源,但是执行sudo yum update命令后遇到以下问题:
mysql-community-server和mysql-community-client没有更新成功,所以根据命令重新安装:
yum -y install mysql-community-server
但是又遇到了报错!!
在网上查到了解决办法是:
该报错的意思是GPG验证不通过,我理解是本机配置的这个软件包对应的公钥不对,签名验证失败。(我也不知道这个公钥是在安装过程哪一步自动配置的)。我在mysql官网搜关键字GPG,找到了解决方案,大意是如果使用的4.1以上版本的rpm的话,除了import mysql的公钥到个人用户的配置中,还需要import mysql的公钥到RPM的配置中。
原文:
If you are using RPM 4.1 and it complains about (GPG) NOT OK (MISSING KEYS: GPG#3a79bd29),
even though you have imported the MySQL public build key into your own GPG keyring,
you need to import the key into the RPM keyring first.
RPM 4.1 no longer uses your personal GPG keyring (or GPG itself).
Rather, RPM maintains a separate keyring because it is a system-wide application and a user’s GPG public keyring is a user-specific file.
To import the MySQL public key into the RPM keyring,
first obtain the key, then use rpm --import to import the key. For example:
解决命令执行以下:
$ gpg --export -a 3a79bd29 > 3a79bd29.asc
$ rpm --import 3a79bd29.asc
Alternatively, rpm also supports loading the key directly from a URL:
$ rpm --import https://repo.mysql.com/RPM-GPG-KEY-mysql-2022
执行后就顺利安装成功!
注意:以上命令只适用于mysql5.7,其他版本见https://dev.mysql.com/doc/refman/5.7/en/checking-rpm-signature.html