阿里镜像站
https://developer.aliyun.com/mirror/
软件下载
DNS
- 223.5.5.5
- 223.6.6.6
- 2400:3200::1
- 2400:3200:baba::1
Liunx 配置
- ipv4
# 编辑 /etc/resolv.conf
nameserver 223.5.5.5
nameserver 223.6.6.6
- ipv6
# 编辑 sudo vim /etc/resolv.conf
nameserver 2400:3200::1
nameserver 2400:3200:baba::1
保存退出,然后使用 dig 验证:
dig alidns.com
npm 设置ali 源:
npm config set registry https://registry.npm.taobao.org
# 查看
npm config get registry
yarn 设置 ali 源:
yarn config set registry https://registry.npm.taobao.org/
# 查看
yarn config get registry
pip 设置ali源:
参考: https://developer.aliyun.com/mirror/pypi
临时修改
pip install scrapy -i http://mirrors.aliyun.com/pypi/simple
永久修改
Linux , 修改pip.conf , 文件,没有就创建一个 .
$HOME/.config/pip/pip.conf
# 修改如下:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
Windows , 修改 pip.ini文件 (没有就创建一个)
%APPDATA%\pip\pip.ini
#修改为如下:
[global]
index-url = http://mirrors.aliyun.com/pypi/simple
Ubuntu 设置 ali源 :
参考: https://developer.aliyun.com/mirror/ubuntu
- 备份
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
- 修改
sudo vim /etc/apt/sources.list
修改为如下内容:
deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse
Maven , Gradle 仓库
参考: https://developer.aliyun.com/mirror/maven
settings.xml中使用
<mirror>
<id>aliyunmaven</id>
<mirrorOf>*</mirrorOf>
<name>阿里云公共仓库</name>
<url>https://maven.aliyun.com/repository/public</url>
</mirror>
Homebrew 仓库
参考: https://developer.aliyun.com/mirror/homebrew
- Bash 终端配置
# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
- Zsh终端
# 替换brew.git:
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
# 替换homebrew-core.git:
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 应用生效
brew update
# 替换homebrew-bottles:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
Docker
参考: https://developer.aliyun.com/mirror/docker-ce
- Ubuntu 14.04/16.04(使用 apt-get 进行安装)
# step 1: 安装必要的一些系统工具
sudo apt-get update
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
# step 2: 安装GPG证书
curl -fsSL https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
# Step 3: 写入软件源信息
sudo add-apt-repository "deb [arch=amd64] https://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
# Step 4: 更新并安装Docker-CE
sudo apt-get -y update
sudo apt-get -y install docker-ce
# 安装指定版本的Docker-CE:
# Step 1: 查找Docker-CE的版本:
# apt-cache madison docker-ce
# docker-ce | 17.03.1~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# docker-ce | 17.03.0~ce-0~ubuntu-xenial | https://mirrors.aliyun.com/docker-ce/linux/ubuntu xenial/stable amd64 Packages
# Step 2: 安装指定版本的Docker-CE: (VERSION例如上面的17.03.1~ce-0~ubuntu-xenial)
# sudo apt-get -y install docker-ce=[VERSION]
网友评论