centos 更换源之后yum下载失败

今天在更换了物理机centos的源之后,yum下载其他软件的时候失败了,同时出现了下面的错误。

Downloading packages:
warning: /var/cache/yum/x86_64/7/extras/packages/epel-release-7-9.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID f4a80eb5: NOKEY`这里写代码片`
Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6


The GPG keys listed for the "CentOS-7 - Extras - 163.com" repository are already installed but they are not correct for this package.
Check that the correct key URLs are configured for this repository.


 Failing package is: epel-release-7-9.noarch
 GPG Keys are configured as: http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

google之后是yum源更新后需要导入 key值,否则就会报上面的错误,无法安装相关的包。 这里的解决办法是加上“–nogpgcheck”就可以了,即去掉gpg检查,然后重新下载epel源

yum install epel-release --nogpgcheck

问题解决。

你可能感兴趣的:(linux)