执行sudo yum update命令无法更新mysql服务

最近想装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

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值