新安装了 redhat6.5. 安装后, 登录系统, 使用 yum update 更新系统. 提示:
- Loaded plugins: product-id, security, subscription-manager
- This system is not registered to Red Hat Subscription Management. You can us e subscription-manager to register.
1. 删除 RedHat 自带的 yum 包
- [[email protected] ~]# rpm -qa |grep yum |xargs rpm -e --nodeps
- [[email protected] ~]# rpm -qa |grep yum
2. 下载新的 yum 包. 使用 Centos6.5 的 yum 包
1) 查看系统类别
- [email protected] ~]# cat /etc/RedHat-release
- Red Hat Enterprise Linux Server release 6.5 (Santiago)
2) 下载新的 yum 包. 使用 Centos6.5 的 yum 包
- [[email protected] ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
- [[email protected] ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm
- [[email protected] ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
- [[email protected] ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm
3) 安装
- [[email protected] ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-81.el6.CentOS.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm python-urlgrabber-3.9.1-11.el6.noarch.rpm
- warning: yum-metadata-parser-1.1.2-16.el6.x86_64.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
- [[email protected] ~]# 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
报错
查找问题, 是 python-urlgrabber 引起的, 要删除掉旧的包
rpm -e python-urlgrabber-3.9.1-9.el6.noarch
安装 rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
再安装
- [[email protected] ~]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm yum-3.2.29-81.el6.CentOS.noarch.rpm yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm
- warning: yum-metadata-parser-1.1.2-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
- Preparing... ########################################### [100%]
- 1:yum-metadata-parser ########################################### [ 33%]
- 2:yum-plugin-fastestmirro########################################### [ 67%]
- 3:yum ########################################### [100%]
- [[email protected] ~]#
4) 更换 yum 源, 将原有源删除或备份到别的目下下:
- #cd /etc/yum.repos.d/
- #wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
- #vi CentOS6-Base-163.repo
编辑文件, 把文件里面的 $releasever 全部替换为版本号: 6(注意, 不是 6.5!) 最后保存!
:%s/$releasever/6/g
3. 清除原有缓存, 重建缓存:
- #yum clean all
- #yum makecache
参考资源:
- http://blog.sina.com.cn/s/blog_439628be0102woxd.html
- https://blog.csdn.net/zhaihaifei/article/details/54616840
来源: http://www.bubuko.com/infodetail-3329210.html