进入/etc/yum.repo.d中
编译repo文件:vim 163.repo
[base]
name=CentOS-$releasever - Base#mirrorlist=http://mirrors.163.com/?release=$releasever&arch=$basearch&repo=osbaseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/devel/RPM-GPG-KEY-CentOS-5#released updates
[update]name=CentOS-$releasever - Updates#mirrorlist=http://mirrors.163.com/?release=$releasever&arch=$basearch&repo=updatesbaseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/devel/RPM-GPG-KEY-CentOS-5#additional packages that may be useful
[extras]name=CentOS-$releasever - Extras#mirrorlist=http://mirrors.163.com/?release=$releasever&arch=$basearch&repo=extrasbaseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=http://mirrors.163.com/centos/devel/RPM-GPG-KEY-CentOS-5#additional packages that extend functionality of existing packages
[centosplus]name=CentOS-$releasever - Plus#mirrorlist=http://mirrors.163.com/?release=$releasever&arch=$basearch&repo=centosplusbaseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=1gpgkey=http://mirrors.163.com/centos/devel/RPM-GPG-KEY-CentOS-5#contrib - packages by Centos Users
[contrib]name=CentOS-$releasever - Contrib#mirrorlist=http://mirrors.163.com/?release=$releasever&arch=$basearch&repo=contribbaseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/gpgcheck=1enabled=0gpgkey=http://mirrors.163.com/centos/devel/RPM-GPG-KEY-CentOS-5
已经更新过的可以直接使用这个命令:yum --enabled 163 check-update
第一次更新会失败,多更新几次就可以了。