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


 

 

你可能感兴趣的:(linux)