流觞区直

导航

2.Yum仓库优化

1.[初始yum源备份]-[yum更换为国内源]-[添加epel扩展源]
#!/bin/bash
mkdir /etc/yum.repos.d/backup/
mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/
if [ `uname -r |awk -F. '{ print $1 }'` -eq 2 ];then
    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
    curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
    yum makecache
fi
if [ `uname -r |awk -F. '{ print $1 }'` -eq 3 ];then
    curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
    yum makecache
fi

 

 
other...

 

posted on 2019-04-16 01:55  流觞区直  阅读(106)  评论(0编辑  收藏  举报