1、pip
Linux系统
mkdir ~/.pip
cat > ~/.pip/pip.conf << EOF
[global]
trusted-host=mirrors.aliyun.com
index-url=https://mirrors.aliyun.com/pypi/simple/
EOF
Windows系统
首先在window的文件夹窗口输入 : %APPDATA%然后创建pip文件夹最后创建pip.ini文件,写入如下内容:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com
2、docker
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://qntdeamw.mirror.aliyuncs.com"]
}
EOF
3、yum
#Centos7 (centos8貌似官方mirrors包含了国内镜像站,会根据本地IP就近选择国内mirros)
#用curl
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
#用wget
wget http://mirrors.aliyun.com/repo/Centos-7.repo
wget http://mirrors.aliyun.com/repo/epel-7.repo
mv Centos-7.repo /etc/yum.repos.d/
mv epel-7.repo /etc/yum.repos.d