更换阿里云镜像
-
方式一:(当刚刚安装的系统下载贼慢时,或者失败时)
-
方式二:
-
yum install wget
-
/etc/yum.repos.d
-
将四个repo文件备份(自己创建个目录cp进去)
-
wget -O /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-6.repo
-
-
yum clean all
-
yum makecache
- 方式三 : 主要方式
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 成功后,执行 yum install 目标应用
网络变慢或者下载不了东西尝试
sed -i "s|enabled=1|enabled=0|g" /etc/yum/pluginconf.d/fastestmirror.conf mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo https://www.xmpan.com/Centos-6-Vault-Aliyun.repo yum clean all yum makecache 来源: https://www.xmpan.com/944.html