RHEL6使用CentOS的yum源

來源:互聯網
上載者:User

標籤:yum

1、卸載RHEL6內建的yum源

rpm -qa | grep yum |xargs rpm -e --nodeps

 

2、下載對應的安裝包

# wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm # wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-3.2.29-40.el6.centos.noarch.rpm # wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm#  wget http://mirror.centos.org/centos-6/6.5/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.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-40.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-14.el6.noarch.rpm

4、配置新的yum源

# cd /etc/yum.repos.d/# wget  http://mirrors.163.com/.help/CentOS6-Base-163.repo# vi CentOS6-Base-163.repo  #編輯檔案 把檔案裡面的$releasever全部替換為版本號碼,即6 最後儲存![base]name=CentOS-6 - Base - 163.combaseurl=http://mirrors.163.com/centos/6/os/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[updates]name=CentOS-6 - Updates - 163.combaseurl=http://mirrors.163.com/centos/6/updates/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[extras]name=CentOS-6 - Extras - 163.combaseurl=http://mirrors.163.com/centos/6/extras/$basearch/gpgcheck=1gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[centosplus]name=CentOS-6 - Plus - 163.combaseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6[contrib]name=CentOS-6 - Contrib - 163.combaseurl=http://mirrors.163.com/centos/6/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

 

5、報錯資訊如下:

# yum makecacheThere was a problem importing one of the Python modulesrequired to run yum. The error leading to this problem was:   No module named yumPlease install a package which provides this module, orverify that the module is installed correctly.It‘s possible that the above module doesn‘t match thecurrent version of Python, which is:2.6.1 (r261:67515, Oct  8 2014, 19:20:42) [GCC 4.4.6 20120305 (Red Hat 4.4.6-4)]If you cannot solve this problem yourself, please go to the yum faq at:

報錯資訊與python版本有關

[[email protected] ~]# whereis pythonpython: /usr/bin/python2.6 /usr/bin/python2.6-config /usr/bin/python /usr/bin/python.old /usr/lib/python2.6 /usr/lib64/python2.6 /usr/include/python2.6 /usr/local/python2.6 /usr/share/man/man1/python.1.gz[[email protected] ~]# which yum/usr/bin/yum將“#!/usr/bin/python2.6”修改為“#!/usr/bin/python2.6”


 

 

本文出自 “冰凍vs西瓜” 部落格,請務必保留此出處http://molewan.blog.51cto.com/287340/1674134

RHEL6使用CentOS的yum源

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.