原因分析:
yum在安装时,需要进行配置yum源
解决方案:
- centos-6 更换 yum 源: 只需要在centos命令行界面下执行一下几条命令
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
2.
centos-7 更换 yum 源:
代码语言:javascript复制#在国内使用默认 yum 源下载软件速度慢,更换国内的 yum 源可以提高软件下载速度
# https://www.cnblogs.com/reasonzzy/p/11143737.html
# 先执行
[root@localhost ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
[root@localhost ~]# yum -y install yum-utils
# 更新 yum 源
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache