在虚拟机安装centos6安装nginx,由于没有进行维护,所有会报错,

centos6.5在使用yum的时候提示错误:removing mirrorlist with no valid mirrors

处理方法:

1、通过执行如下命令修改fastestmirror.conf的配置参数

sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf

2、备份文件

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

3、如果是香港服务器或者海外,替换为官方Vault源

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Official.repo

如果是国内建议使用阿里云,执行如下

curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo