超简单配置CentOS6/7的yum源

cd /etc/yum.repos.d #切换到yum仓库目录
yum -y install wget #安装wget工具
mv  CentOs-Base.repo CentOs-Base.repo.bak #备份原Base.repo

#CentOS6
wget -O CentOS6-aliyun.repo http://mirrors.aliyun.com/repo/Centos-6.repo
mv CentOS6-aliyun.repo CentOS-Base.repo
yum -y install epel-release
 
#CentOS7
wget -O CentOS7-aliyun.repo http://mirrors.aliyun.com/repo/Centos-7.repo
mv CentOS7-aliyun.repo CentOS-Base.repo
yum -y install epel-release

猜你喜欢

转载自www.cnblogs.com/yexuesong/p/9156745.html
今日推荐