RedHat6.6 更換CentOS6 yum和yum源

NO IMAGE
redhat預設自帶的yum源需要註冊,才能更新,報錯:
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
可替換為centos對應的源。 操作如下:

 

1、刪除redhat原有的yum

 

rpm -aq|grep yum|xargs rpm -e –nodeps

 

 

2、下載yum安裝檔案

 

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-81.el6.centos.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm

wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm

 

 

 

3、安裝元件

 

 

rpm
-ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
rpm
-ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm

 下面安裝失敗了

#
rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-37.el6.noarch.rpm
warning:
yum-3.2.29-81.el6.centos.noarch.rpm:Header V3 RSA
/SHA1Signature,
key ID c105b9de: NOKEY
error:
Failed dependencies:
       python-urlgrabber
>= 3.9.1-10 is needed byyum-3.2.29-81.el6.centos.noarch
You
have new mail
in/var/spool/mail/root

 


少python-urlgrabber 元件,下載:

 

http://mirrors.163.com/centos/6/os/x86_64/Packages/python-urlgrabber-3.9.1-11.el6.noarch.rpm

 

#
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 IDc105b9de: NOKEY
Preparing...              
########################################### [
100%]
       file
/usr/lib/python2.
6/site-packages/urlgrabber/grabber.py
from installof python-urlgrabber-
3.9.1-11.el6.noarch
conflicts with file from packagepython-urlgrabber-
3.9.1-9.el6.noarch
       file
/usr/lib/python2.
6/site-packages/urlgrabber/grabber.pyc
frominstall of python-urlgrabber-
3.9.1-11.el6.noarch
conflicts with file frompackage python-urlgrabber-
3.9.1-9.el6.noarch
       file
/usr/lib/python2.
6/site-packages/urlgrabber/grabber.pyo
frominstall of python-urlgrabber-
3.9.1-11.el6.noarch
conflicts with file frompackage python-urlgrabber-
3.9.1-9.el6.noarch
       file
/usr/lib/python2.
6/site-packages/urlgrabber/progress.pyc
frominstall of python-urlgrabber-
3.9.1-11.el6.noarch
conflicts with file frompackage python-urlgrabber-
3.9.1-9.el6.noarch
       file
/usr/lib/python2.
6/site-packages/urlgrabber/progress.pyo
frominstall of python-urlgrabber-
3.9.1-11.el6.noarch
conflicts with file frompackage python-urlgrabber-
3.9.1-9.el6.noarch

 

 

 

下載個python2.6重灌

 

wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/security/python-2.6.6-64.el6.x86_64.rpm

 —-檢視當前python rpm版本—-

————

#rpm
-e python-2.6.6-52.el6.x86_64 --nodeps
#
rpm -ivh python-2.6.6-64.el6.x86_64.rpm

 

有報錯,需要依賴包,繼續

#
rpm -ivh python-libs-
2.6.6-64.el6.x86_64.rpm
python-
2.6.6-64.el6.x86_64.rpm
--nodeps  --force

 

warning:python-libs-2.6.6-64.el6.x86_64.rpm:
Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...              
########################################### [
100%]
  1:python               
########################################### [
50%]
  2:python-libs          
########################################### [
100%]

沒問題,可以繼續

 

Phtyon url 也要粗暴下

#
rpm -ivh python-urlgrabber-
3.9.1-11.el6.noarch.rpm
--nodeps --force
warning:python-urlgrabber-3.9.1-11.el6.noarch.rpm:
Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...              
########################################### [
100%]
  1:python-urlgrabber    
########################################### [
100%]

 

 

 

安裝yum

 

#
rpm -ivh yum-
3.2.29-81.el6.centos.noarch.rpm
yum-plugin-fastestmirror-
1.1.30-37.el6.noarch.rpm
warning:yum-3.2.29-81.el6.centos.noarch.rpm:
Header V3 RSA/SHA1 Signature, key IDc105b9de: NOKEY
Preparing...              
########################################### [
100%]
  1:yum-plugin-fastestmirro###########################################
[
50%]
  2:yum                  
########################################### [
100%]

 

 

 

 訂閱就不要了,反正也沒錢

#
rpm -qa | grep subsc*
subscription-manager-1.12.14-7.el6.x86_64
#
rpm -e subscription-manager-
1.12.14-7.el6.x86_64

4、設定yum

下載repo檔案 到  /etc/yum.repos.d/

http://mirrors.163.com/.help/CentOS7-Base-163.repo

 把檔案裡面的$releasever全部替換為版本號:6

清除原有快取,重建快取,更新

  1.     yum clean all

  2.     yum makecache

  3.     yum update

 

 

 

    完成

參考

 

網易:http://mirrors.163.com/centos/6/os/x86_64/Packages/

 

http://433266.blog.51cto.com/423266/1852899

 

http://www.iyunv.com/thread-41279-1-1.html

 

http://blog.sina.com.cn/s/blog_50f908410101cto6.html
wget ftp://mirror.switch.ch/pool/4/mirror/scientificlinux/6.5/x86_64/updates/security/python-2.6.6-64.el6.x86_64.rpm