1.声明
当前内容主要用与解决在CentOS7的mini版本中使用yum的时候出现了问题的解决办法
当前问题描述:
在一个新装的CentOS7mini版中配置了aliyun的repo,结果执行yum install出现的问题(直接在阿里下载的repo)
warning: /var/cache/yum/x86_64/7/updates/packages/grub2-tools-extra-2.02-0.87.el7.centos.2.x86_64.rpm: Head er V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY
Retrieving key from http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
The GPG keys listed for the "CentOS-7 - Updates - mirrors.aliyun.com" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.
2.解决办法
- 每次执行yum的时候都添加
--nogpgcheck
,例如:yum install XXX --nogpgcheck
- 第二种导入gpg并实际修改repo文件
- 导入repo:
gpg --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
- 修改/etc/yum.repos.d/中的主要的repo
将其中的6全部都修改为7
- 导入repo:
最后执行的结果:
个人建议使用第二种方法,这个方法配置就不用每次都写了!