Common Development Tool Sources and Chinese Mirrors

Common Development Tool Sources and Chinese Mirrors

Due to well-known reasons, accessing foreign websites has always been slow in China, and many package management software used in development access foreign sources, often frustratingly slow. This post collects some commonly used mirrors for reference.

pip

Temporary Use

Copy the command and add the package name or other parameters at the end

# Tsinghua source, supports https, reasonably fast
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple
# Aliyun source, quite fast (especially on Aliyun), does not support https
pip install -i http://mirrors.aliyun.com/pypi/simple/ --trusted-host mirrors.aliyun.com

Permanent Configuration

Create or edit ~/.pip/pip.conf

Tsinghua source

# This command will overwrite the original pip configuration
mkdir -p ~/.pip
echo "[global]
index-url = https://pypi.tuna.tsinghua.edu.cn/simple" > ~/.pip/pip.conf

Aliyun source

# This command will overwrite the original pip configuration
mkdir -p ~/.pip
echo "[global]
index-url = http://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host = mirrors.aliyun.com" > ~/.pip/pip.conf

pyenv

I used Qiniu’s mirror function to build my own mirror Use when installing

export PYTHON_BUILD_MIRROR_URL="http://pyenv.qiniudn.com/pythons/"

Then pyenv install VERSION as usual, but now it seems the official no longer offers most pre-compiled packages, most versions require downloading the source code for installation, and the source code’s URL is hardcoded, temporarily unable to speed up, can only manually modify the python-build related files to achieve

Before installing, you can first open http://pyenv.qiniudn.com/pythons/ to confirm whether the version you want to install has a compiled package available

Docker

Docker Engine

Installing Docker Engine from the official source is quite slow, here you can use the installation mirror provided by DaoCloud:

curl -sSL https://get.daocloud.io/docker | sh

Docker Registry

After installing Docker, pulling images is still very slow, Daocloud’s acceleration service doesn’t feel very fast for personal use, I still use the mirror function of Aliyun’s Developer Platform recently launched

Enter Developer Platform

Click on the accelerator on the left, find your own exclusive accelerator address, the page also has installation instructions, generally is to edit /etc/default/docker file, add --registry-mirror=https://XXXXXXXXX.mirror.aliyuncs.com in DOCKER_OPTS

XXXXXXXXX is your own mirror address

Docker Machine

If using docker-machine to create machines, you can configure the registry mirror at the same time during installation

docker-machine create --driver generic --generic-ip-address=MACHINE_IP --engine-install-url=https://get.daocloud.io/docker --engine-registry-mirror="https://XXXXXXXXX.mirror.aliyuncs.com" MACHINE_NAME

NPM

Because of npm’s own issues, even using a mirror, installation is still not fast, you need to add some hacks, such as turning off the progress bar, etc., so it is recommended to directly use cnpm provided by Aliyun for installation

Install cnpm

Temporary Use

npm install --registry=https://registry.npm.taobao.org

Permanent Configuration

npm install -g cnpm --registry=https://registry.npm.taobao.org

Afterwards use

cnpm install

for installation

Ruby Gem

Use Taobao source

gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
# If using bundle
bundle config mirror.https://rubygems.org https://ruby.taobao.org
comments powered by Disqus