执行如下命令:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.old
vim /etc/yum.repos.d/CentOS-Base.repo (粘贴下面的更新源地址,[小提示]vim粘贴方法:首先选中更新源地址内容,然后在vim中按下字母i进入编辑模式,然后点击鼠标中间,即可粘贴刚才选中的内容)
yum update
更新源地址如下:
[base]
name=CentOS-6 - Base
repo=os
baseurl=http://mirrors.163.com/centos/6.4/os/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[update]
name=CentOS-6 - Updates
baseurl=http://mirrors.163.com/centos/6.4/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#packages used/produced in the build but not released
#[addons]
#name=CentOS-6 - Addons
#baseurl=http://mirrors.163.com/centos/6.4/addons/$basearch/
#gpgcheck=1
#gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-6 - Extras
baseurl=http://mirrors.163.com/centos/6.4/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6 - Plus
baseurl=http://mirrors.163.com/centos/6.4/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-6 - Contrib
baseurl=http://mirrors.163.com/centos/6.4/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6