Fedora dnf gcc 时候警告/etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64问题

时间:2022-06-02 00:15:22

dnf install gcc

出现如下:

警告:/var/cache/dnf/fedora-022e0d5fd8a6b38e/packages/gcc-7.1.1-3.fc26.x86_64.rpm: 头V3 RSA/SHA256 Signature, 密钥 ID 64dab85d: NOKEY
Curl error (37): Couldn't read a file:// file for file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64 [Couldn't open file /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-x86_64]

解决方法: 红色版本按自己实际修改

一:    rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-x86_64

二:  1.   rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-26-primary

      2.   rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-rpmfusion-nonfree-fedora-26

两种方式解决,