本人CentOS是x86_64,6.4版本
root之后,改写/etc/yum.repos.d/CentOS-Base.repo文件为如下内容:
# CentOS-Base.repo## The mirror system uses the connecting IP address of the client and the# update status of each mirror to pick mirrors that are updated to and# geographically close to the client. You should use this for CentOS updates# unless you are manually picking other mirrors.## If the mirrorlist= does not work for you, as a fall back you can try the# remarked out baseurl= line instead.##[base]name=CentOS-$releasever - Base - 163.commirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=osbaseurl=http://mirrors.163.com/centos/6.4/os/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#released updates[updates]name=CentOS-$releasever - Updates - 163.commirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=updatesbaseurl=http://mirrors.163.com/centos/6.4/updates/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that may be useful[extras]name=CentOS-$releasever - Extras - 163.commirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=extrasbaseurl=http://mirrors.163.com/centos/6.4/extras/x86_64/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus - 163.commirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=centosplusbaseurl=http://mirrors.163.com/centos/6.4/centosplus/x86_64/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6#contrib - packages by Centos Users[contrib]name=CentOS-$releasever - Contrib - 163.commirrorlist=http://mirrorlist.centos.org/?release=6.4&arch=x86_64&repo=contribbaseurl=http://mirrors.163.com/centos/6.4/contrib/x86_64/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6