Linux问题:解决CentOS7-mini问题(Check that the correct key URLs are configured for this repository.)

1.声明

当前内容主要用与解决在CentOS7的mini版本中使用yum的时候出现了问题的解决办法
当前问题描述:

在一个新装的CentOS7mini版中配置了aliyun的repo,结果执行yum install出现的问题(直接在阿里下载的repo)

  1. 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
  2. Retrieving key from http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6
  3. The GPG keys listed for the "CentOS-7 - Updates - mirrors.aliyun.com" repository are already installed but they are not correct for this package.
  4. Check that the correct key URLs are configured for this repository.

在这里插入图片描述

2.解决办法

  1. 每次执行yum的时候都添加--nogpgcheck,例如:yum install XXX --nogpgcheck
  2. 第二种导入gpg并实际修改repo文件
    1. 导入repo:gpg --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
    2. 修改/etc/yum.repos.d/中的主要的repo
      在这里插入图片描述
      将其中的6全部都修改为7
      在这里插入图片描述

最后执行的结果:
在这里插入图片描述
在这里插入图片描述

个人建议使用第二种方法,这个方法配置就不用每次都写了!

猜你喜欢

转载自blog.csdn.net/weixin_45492007/article/details/114527511