1、修改 /etc/yum.repos.d/CentOS-Base.repo,替换未 查看模式下按200dd,删除200行的意思,然后按o,或者i进入编辑模式
2、粘贴如下内容,主要linxu粘贴的时候,会粘贴少内容顶部的内容会不完全粘贴进去,主要对比,还有我用的是centos6,
[base] name=CentOS-6 - Base baseurl=http://mirrors.163.com/centos/6/os/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [updates] name=CentOS-6 - Updates baseurl=http://mirrors.163.com/centos/6/updates/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [extras] name=CentOS-6 - Extras baseurl=http://mirrors.163.com/centos/6/extras/$basearch/ gpgcheck=1 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [centosplus] name=CentOS-6 - Plus baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 [contrib] name=CentOS-6 - Contrib baseurl=http://mirrors.163.com/centos/6/contrib/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6