新安裝了redhat6.5安裝後,登錄系統,使用yum update 更新系統。提示: This system is not registered to Red Hat Subscription Management. You can use subscription-manager to regi ...
新安裝了redhat6.5安裝後,登錄系統,使用yum update 更新系統。提示:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
無法更新。
redhat 預設自帶的 yum 源需要註冊,才能更新。我們想不花錢也可以更新,需要替換掉redhat的yum源。
1.檢查是否安裝yum包
查看RHEL是否安裝了yum,若是安裝了,那麼又有哪些yum包:
[root@localhost ~]# rpm -qa |grep yum yum-metadata-parser-1.0-8.fc6 yum-3.0.1-5.el5 yum-rhn-plugin-0.4.3-1.el5 yum-updatesd-3.0.1-5.el5
2 刪除redhat自帶的yum包
卸載上面顯示的所有yum包:
[root@localhost ~]# rpm -qa|grep yum|xargs rpm -e --nodeps(不檢查依賴,直接刪除rpm包)再用 [root@localhost ~]# rpm -qa |grep yum [root@localhost ~]#
查看,無信息顯示表示已經卸載完成。
3.下載新的yum包。使用Centos6.5的yum包
[root@madao yum.repos.d]# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-3.2.29-60.el6.centos.noarch.rpm
[root@madao yum.repos.d]# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@madao yum.repos.d]# wget http://mirrors.163.com/centos/6/os/i386/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
[root@madao yum.repos.d]# wget http://mirrors.163.com/centos/6/os/i386/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
(這裡的地址不一定對)
如果404?直接到http://mirrors.163.com/centos/6/os/上自己找就OK了
安裝yum
[root@madao yum.repos.d]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm [root@madao yum.repos.d]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm [root@madao yum.repos.d]# rpm -ivh yum-3.2.29-60.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm //rpm -ivh yum和yum-plugin-fastestmirror有相依性,所以要一起裝
如果按照遇到問題:發現錯誤,python-urlgrabber版本必須大於等於3.9.1-10
# rpm -ivh yum-3.2.29-73.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm warning: yum-3.2.29-73.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY error: Failed dependencies: python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-73.el6.centos.noarc
查看系統的python信息
# rpm -qa|grep python
發現python-urlgrabber-3.9.1-9.el6.noarch 版本低於3.9.1-10
卸載:python-urlgrabber-3.9.1-9.el6.noarch
rpm -e python-urlgrabber-3.9.1-9.el6.noarch
安裝:rpm -ivh python-urlgrabber-3.9.1-11.el6.noarch.rpm
或者編輯配置文件
#vim CentOS-Base.repo
把$releasever替換成現有系統的版本號(6)
vim替換命令
:%s/$releasever/6/g
退出保存
清理yum緩存
#yum clean all 將伺服器軟體包信息緩存至本地,提高搜索安裝效率 #yum makecache
測試
#yum seach vim
轉載:http://qingwang.blog.51cto.com/505009/1551228