linux 更换yum源
更换yum源
@
- 首先安装wget
- yum install wget -y
- 将系统原始配置文件失效
- mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
- 使用Wget获取阿里yum源配置文件 (选取自己需要的版本)
- wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
- wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 清空以前yum源的缓存
- yum clean all
- 获取阿里云的缓存
- yum makecache
- 查看是否成功