1. 程式人生 > >RedHat6配置網路yum源

RedHat6配置網路yum源

1、yum映象源:網易
    開源映象地址:http://mirrors.163.com/centos/6/os/x86_64/Packages/

2、下載安裝包   (https://download.csdn.net/download/weixin_36524613/10541169
    python-iniparse-0.3.1-2.1.el6.noarch.rpm
    yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
    yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm
    yum-3.2.29-81.el6.centos.noarch.rpm

3、刪除本地已安裝的yum
    rpm -qa|grep yum|xargs rpm -e --nodeps
    檢視是否還在
    rpm -qa|grep yum

4、安裝剛才下載的rpm

    1)rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm  

    2)rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm  

    3)rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm  

5、最後一步出現錯誤
    error: Failed dependencies:
    python-urlgrabber >= 3.9.1-10 is needed by yum-3.2.29-81.el6.centos.noarch
    缺少python-urlgrabber包

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

    rpm -ivh --force python-urlgrabber-3.9.1-11.el6.noarch.rpm


6、重新安裝4.3
    rpm -ivh yum-3.2.29-81.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-40.el6.noarch.rpm  

7、更新repo檔案

    mv /etc/yum.repos.d/rhel-source.repo /etc/yum.repos.d/rhel-source.repo.bak

    vim /etc/yum.repos.d/rhel-debuginfo.repo

    內容為

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/6/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6


[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/6/os/x86_64/RPM-GPG-KEY-CentOS-6

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/6./centosplus/$basearch/
gpgcheck=1
enabled=0

8、測試

   yum install  gcc