03月12, 2019

Centos YUM 源加速

基础源

# Centos
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

# epel
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

Docker

# docker-ce
curl -o /etc/yum.repos.d/docker-ce.repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo

# ADD China registry mirror
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
  "registry-mirrors": ["https://registry.docker-cn.com"]
}
EOF

Percona Server for MySQL

# Install the Percona repository
# https://repo.percona.com/yum/percona-release-latest.noarch.rpm
yum install https://mirrors.tuna.tsinghua.edu.cn/percona/yum/percona-release-latest.noarch.rpm

# Change url to tsinghua
sed -i 's#http://repo.percona.com#https://mirrors.tuna.tsinghua.edu.cn#g' \
/etc/yum.repos.d/percona-original-release.repo

SaltStack

# Install
yum install https://mirrors.aliyun.com/saltstack/yum/redhat/salt-repo-latest-2.el7.noarch.rpm

# Change url to aliyun
sed -i "s/repo.saltstack.com/mirrors.aliyun.com\/saltstack/g" \
/etc/yum.repos.d/salt-latest.repo

注:阿里云VPC网络环境下,可以将mirrors.aliyun.com域名地址改为mirrors.cloud.aliyuncs.com,走内网加速。参见 OPSX 软件仓库介绍

本文链接:https://fandenggui.com/post/centos-yum-mirror-acceleration.html

-- EOF --

Comments