Skip to content

Instantly share code, notes, and snippets.

@hydrz
Last active December 6, 2019 08:33
Show Gist options
  • Save hydrz/cf4df2e8319290fd7ce06f0cfeb0b086 to your computer and use it in GitHub Desktop.
Save hydrz/cf4df2e8319290fd7ce06f0cfeb0b086 to your computer and use it in GitHub Desktop.
常用国内源镜像
#!/bin/sh
mv /etc/apk/repositories /etc/apk/repositories.backup
sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
# apk add --no-cache
#!/bin/sh
# base
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
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
## yum makecache
# epel
mv /etc/yum.repos.d/epel.repo /etc/yum.repos.d/epel.repo.backup
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
## curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
## yum makecache
#!/bin/sh
## debian 9.x (stretch)
mv /etc/apt/sources.list /etc/apt/sources.list.backup
cat <<-EOF > /etc/apt/sources.list
deb http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch main non-free contrib
deb http://mirrors.aliyun.com/debian-security stretch/updates main
deb-src http://mirrors.aliyun.com/debian-security stretch/updates main
deb http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-updates main non-free contrib
deb http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
deb-src http://mirrors.aliyun.com/debian/ stretch-backports main non-free contrib
EOF
# apt update
#!/bin/sh
mv /etc/pip.conf /etc/pip.conf.backup
cat <<-EOF > /etc/pip.conf
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment