CentOS 6 更改 yum 源和 epel 源到阿里云

1.备份原来的yum源

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

2.设置yum源为阿里云

wget http://mirrors.aliyun.com/repo/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo

3.添加epel源

wget http://mirrors.aliyun.com/repo/epel-6.repo -O /etc/yum.repos.d/epel.repo

4.清理缓存并生成新的缓存

yum clean all 
yum makecache

综合命令:

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
wget http://mirrors.aliyun.com/repo/Centos-6.repo -O /etc/yum.repos.d/CentOS-Base.repo
yum clean all 
yum makecache
yum install epel-release
wget http://mirrors.aliyun.com/repo/epel-6.repo -O /etc/yum.repos.d/epel.repo
yum clean all 
yum makecache

 

如果您喜欢本站,点击这儿 不花一分钱捐赠老基友

这些信息可能会帮助到你: 下载帮助

发表评论

邮箱地址不会被公开。 必填项已用*标注