1、卸载自带的yum包
# rpm -e --nodeps yum

2、安装新yum包
# rpm -Uvh python-urlgrabber-3.10-8.el7.noarch.rpm

# rpm -ivh --force yum-3.4.3-150.el7.centos.noarch.rpm yum-metadata-parser-1.1.4-10.el7.x86_64.rpm yum-plugin-fastestmirror-1.1.31-40.el7.noarch.rpm

另外获取RPM-GPG-KEY-CentOS-7文件

导入key
#rpm --import  RPM-GPG-KEY-CentOS-7


3、yum配置
[root@bogon yum.repos.d]# cat CentOS-Base-163.repo
[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.163.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/7/os/x86_64/RPM-GPG-KEY-CentOS-7


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


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

[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.163.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0

4、更新包
#yum clean all 清除原有缓存
#yum makecache 获取yum列表

5、更新所有系统包
#yum upgrade all