redhat6.5 配置使用centos的yum源


新安裝了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包

[root@localhost ~]# rpm -qa |grep yum |xargs rpm -e --nodeps
[root@localhost ~]# rpm -qa |grep yum

2.下載新的yum包。使用Centos6.5的yum包

1)查看系統類別

root@localhost ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.5 (Santiago)

2)下載新的yum包。使用Centos6.5的yum包

[root@localhost ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-41.el6.noarch.rpm

[root@localhost ~]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

3)安裝

[root@localhost ~]# 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
[root@localhost ~]# 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

再安裝

[root@localhost ~]# 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%]
[root@localhost ~]#

 

  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

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM