步骤一:清除redhat原有的yum源
步骤二:下载163的yum包
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-3.4.3-132.el7.centos.0.1.noarch.rpm
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/python-iniparse-0.4-9.el7.noarch.rpm wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-metadata-parser-1.1.4-10.el7.x86_64.rpm
wget http://mirrors.163.com/centos/7.2.1511/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.31-34.el7.noarch.rpm
步骤三:安装下载的yum包
步骤四:创建文件/etc/yum.repos.d/rhel-Base.repo并写入(复制我的即可)
[base]
name=CentOS-$releasever - Basebaseurl=http://mirrors.163.com/centos/7.2.1511/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7#released updates
[updates]
name=CentOS-$releasever - Updatesbaseurl=http://mirrors.163.com/centos/7.2.1511/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[extras]
name=CentOS-$releasever - Extrasbaseurl=http://mirrors.163.com/centos/7.2.1511/extras//$basearch/
gpgcheck=1gpgkey=http://mirrors.163.com/centos/7.2.1511/os/x86_64/RPM-GPG-KEY-CentOS-7
[centosplus]
name=CentOS-$releasever - Plusbaseurl=http://mirrors.163.com/centos/7.2.1511/centosplus//$basearch/
gpgcheck=1enabled=0
步骤五:清理yum缓存和测试yum
如图,正在更新,表示配置成功。