转载于https://www.cnblogs.com/yunjisuan1024/p/11652272.html、https://blog.csdn.net/qq_37674858/article/details/89554828如有侵权请联系删除
1. 将旧的yum源移到其他位置,只使用阿里云的yum源安装软件
cd /etc/yum.repos.d
mkdir backup
mv C* backup
2. 下载阿里云的yum源到了/etc/yum.repos.d中,所以不需要切换到/etc/yum.repos.d目录下
CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3 yum install xxxx测试
4 如遇到 yum提示找不到依赖(提示:No package …… available)
首先用命令 sudo yum install epel-release
安装上面说的epel-release,然后继续下面步骤。
更新yum以及其它软件包:
sudo yum update