【原创】配置网络yum源遇到的问题之解决办法

发布于 2017-08-10  499 次阅读


1.yum makecache后,提示以下报错:

file://media/CentOS/repodata/repomd.xml:%20[Errno%2014]%20Could%20not%20open/read%2

解决方法:

我配置的是yum源是:wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

解决以上问题,需要注释掉以下信息:

在CentOS-Base-sohu.repo中注释掉下面的内容
#[addons]
#name=CentOS-$releasever - Addons - sohu.com
#mirrorlist=http://mirrorlist.centos.org/?release=releasever&arch=basearch&repo=addons
#baseurl=http://mirrors.sohu.com/centos/releasever/addons/basearch/
#gpgcheck=1
#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5CentOS-Base-sohu.repo
2.解决以上问题后,又提示以下报错:
file:///media/CentOS/repodata/repomd.xml: [Errno 14] Could not open/read file:///media/CentOS/repodata/repomd.xml
出现以上问题是因为开启了本地yum源,关闭就好了
将/etc/yum.repos.d/CentOS-Media.repo里面的enabled=1改成enabled=0即可
执行完以上两步操作后,在执行yum -y install vim* 都可以正确的安装了。
3.以上问题解决后,yum安装vim*,又提示以下报错:

Downloading Packages:
warningrpmts_HdrFromFdnoHeader V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Retrieving key from file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

GPG key retrieval failed: [Errno 14] Could not open/read file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

解决办法:

编辑yum源文件:替换  RPM-GPG-KEY-CentOS-5  替换为对应的 key 文件名:RPM-GPG-KEY-CentOS-6 (要全部替换

root@localhost yum.repos.d]# vi CentOS-Base-sohu.repo
[base]
name=CentOS-releasever - Base - sohu.com
mirrorlist=http://mirrorlist.centos.org/?release=
releasever&arch=basearch&repo=os
baseurl=http://mirrors.sohu.com/centos/
releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

此解决方法原地址:http://blog.csdn.net/wulantian/article/details/20911687

欢迎各位关注左下角的微信公众号,第一时间掌握本站最新信息和IT前沿信息,同时公众号中会不断更新私有IT资源哟!!