背景
CentOS Linux 7 将于 2024 年 6 月 30日停止维护,终止其生命周期。当产品或服务不再进行更新时,意味着其生命周期终止(EOL)。使用它的企业或机构必须迁移到新的解决方案,才能继续获得更新和安全补丁。如果用户运行的是 CentOS Linux 7则应在 2024 年 6 月 30 日之前迁移到新的操作系统,这样才能继续获得安全更新、补丁和新功能。西塘也在不断尝试新的操作系统,例如Alma Linux,Rocky Linux,Debian,Ubuntu等,此前也尝试过Alma Linux总体还是比较符合CentOS的操作习惯,2024年1月又一次在虚拟机安装的Alma Linux 8进行测试,执行更新操作时却出现“Error: GPG check FAILED”错误:
[w3sun@workstation ~]# yum update -y ..........日......志......省......略.................... Public key for libstdc++-8.5.0-18.el8.alma.x86_64.rpm is not installed. Failing package is: libstdc++-8.5.0-18.el8.alma.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux Public key for ncurses-6.1-9.20180224.el8_8.1.x86_64.rpm is not installed. Failing package is: ncurses-6.1-9.20180224.el8_8.1.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux Public key for ncurses-base-6.1-9.20180224.el8_8.1.noarch.rpm is not installed. Failing package is: ncurses-base-6.1-9.20180224.el8_8.1.noarch GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux Public key for ncurses-libs-6.1-9.20180224.el8_8.1.x86_64.rpm is not installed. Failing package is: ncurses-libs-6.1-9.20180224.el8_8.1.x86_64 GPG Keys are configured as: file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux The downloaded packages were saved in cache until the next successful transaction. You can remove cached packages by executing 'dnf clean packages'. Error: GPG check FAILED
虽然执行GPG Key重新导入操作,但是问题依然没有解决:
[w3sun@workstation ~]# rpm --import "file:///etc/pki/rpm-gpg/RPM-GPG-KEY-AlmaLinux" [w3sun@workstation ~]# dnf clean packages
解决方法
通过查阅Alma Linux官方博客发现AlmaLinux 8的GPG 密钥在2024年1月份进行了变更,需要重新导入:
[w3sun@workstation ~]# rpm --import https://repo.almalinux.org/almalinux/RPM-GPG-KEY-AlmaLinux [w3sun@workstation ~]# dnf clean packages [w3sun@workstation ~]# yum update -y
此时再进行更新操作即可成功,当然如果不知道GPG Key变更的前提下通过禁止GPG检查也能更新,但是不建议这么做。关于AlmaLinux 8 GPG 密钥变更的声明可以参考:
https://almalinux.org/blog/2023-12-20-almalinux-8-key-update/
转载请注明:雪后西塘 » AlmaLinux 8 GPG 密钥变更解决Error: GPG check FAILED问题