redhat6.5安装yum源。
我是按照这篇文章安装的https://www.cnblogs.com/zwgblog/p/5840486.html。在安装过程中报错:
一、
[root@xxzx tmp]# rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/grabber.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyc from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
file /usr/lib/python2.6/site-packages/urlgrabber/progress.pyo from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch
“file /usr/lib/python2.6/site-packages/urlgrabber/grabber.py from install of python-urlgrabber-3.9.1-11.el6.noarch conflicts with file from package python-urlgrabber-3.9.1-9.el6.noarch”
可以看出报错是由于与历史版本发生冲突。
解决办法:执行以下命令,强制安装。
[root@xxzx tmp]# rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm
执行结果如下:
warning: python-urlgrabber-3.9.1-11.el6.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:python-urlgrabber ########################################### [100%]
[root@xxzx tmp]# rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
warning: yum-3.2.29-81.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
1:yum-plugin-fastestmirro########################################### [ 50%]
2:yum warning: /etc/yum.conf created as /etc/yum.conf.rpmnew
########################################### [100%]
表明安装成功。
二、执行yum makecache时报错
yum makecache
http://mirrors.163.com/centos/6.5/os/x86_64/repodata/repomd.xml: [Errno 14] PYCURL ERROR 22 - "The requested URL returned error: 404 Not Found"
尝试其他镜像。
To address this issue please refer to the below knowledge base article
https://access.redhat.com/articles/1320623
If above article doesn't help to resolve this issue please open a ticket with Red Hat Support.
错误:Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
/etc/*.repo配置文件中的baseurl写错了,应该是baseurl=http://mirrors.163.com/centos/6/os/$basearch/
,我写成了baseurl=http://mirrors.163.com/centos/6.5/os/$basearch/
。修改之后正确执行,如下:
[root@xxzx yum.repos.d]# yum makecache
base | 3.7 kB 00:00
base/group_gz | 242 kB 00:00
base/filelists_db | 6.4 MB 00:00
base/primary_db | 4.7 MB 00:00
base/other_db | 2.8 MB 00:00
extras | 3.4 kB 00:00
extras/filelists_db | 24 kB 00:00
extras/prestodelta | 1.1 kB 00:00
extras/primary_db | 27 kB 00:00
extras/other_db | 28 kB 00:00
rhel-media | 3.9 kB 00:00 ...
rhel-media/group_gz | 204 kB 00:00 ...
rhel-media/filelists_db | 3.8 MB 00:00 ...
rhel-media/primary_db | 3.1 MB 00:00 ...
rhel-media/other_db | 1.6 MB 00:00 ...
updates | 3.4 kB 00:00
updates/filelists_db | 1.7 MB 00:00
updates/prestodelta | 79 kB 00:00
updates/primary_db | 2.4 MB 00:00
updates/other_db | 33 MB 00:00
元数据缓存已建立