yum安装报错:Failure when receiving data from the peer
系统:Centos6.9
操作:yum install -y *.rpm
报错信息:
Transaction Summary ========================================== Install 28 Package(s) Upgrade 7 Package(s) Total size: 1.4 G Downloading Packages: warning: rpmts_HdrFromFdno: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY Retrieving key from http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 GPG key retrieval failed: [Errno 14] PYCURL ERROR 56 - "Failure when receiving data from the peer"
分析:报错信息中说明不能下载到文件:RPM-GPG-KEY-CentOS-6,可能是源配置有问题, 在此我用的是163的源,对于key的配置是这样的:gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6,用wget试着下载,也报错:"HTTP request sent, awaiting response...",至此陷入僵局。后来看到系统默认源里有这样的配置:gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6,也就是说这个文件在系统中是默认存在的,根本不需要下载,于是把163里的gpgkey也指向了此文件,然后再安装的时候就正常了。