centos yum源优化(入职小灰)

版权声明:欢迎转发,不过要带有转发地址哦⁄(⁄ ⁄•⁄ω⁄•⁄ ⁄)⁄ https://blog.csdn.net/qq_37960324/article/details/82215390

整理下,可以做xshell脚本

优化yum源到阿里云源

CentOS

1:备份

mkdir /etc/yum.repos.d/bak -p
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/bak


2:下载新的CentOS-Base.repo 到/etc/yum.repos.d/
 

CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
或
curl -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
或
curl -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
或
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3: yum makecache

epel 配置

1:备份epel

mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/bak
mv /etc/yum.repos.d/epelany.repo /etc/yum.repos.d/bak


2、下载repo
 

epel(RHEL 7)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
epel(RHEL 6)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo
epel(RHEL 5)
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-5.repo

 

猜你喜欢

转载自blog.csdn.net/qq_37960324/article/details/82215390