国内镜像

Jul 18, 2016 21:44 · 212 words · 1 minute read

python

编辑或者新建 ~/.pip/pip.conf (Windows下是 %HOMEPATH%/pip/pip.ini )

[global]
index-url = http://pypi.v2ex.com/simple
[install]
trusted-host = pypi.v2ex.com

OR

[global]
index-url = http://pypi.douban.com/simple
[install]
trusted-host = pypi.douban.com

ruby

taobao.org的源 已经停止维护

https://gems.ruby-china.org/

gem -v #查看版本
gem sources --add https://gems.ruby-china.org/ --remove https://ruby.taobao.org/  #移除原来的淘宝源
gem sources -l  #根据输出的内容 确保里面只有一条记录即可 否则使用`--remove`移除无用的即可
gem update --system #添加完之后就可以更新了

homebrew

http://ban.ninja/

bash

~/.bashrc 中加入

export HOMEBREW_BOTTLE_DOMAIN=http://7xkcej.dl1.z0.glb.clouddn.com

OR

http://homebrew-mirror-china.tycdn.net/

OR

中科大的源 >https://lug.ustc.edu.cn/wiki/mirrors/help/homebrew-bottles >https://lug.ustc.edu.cn/wiki/mirrors/help/brew.git

cd /usr/local
git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bashrc

NPM

$ npm install -g cnpm --registry=https://registry.npm.taobao.org
alias cnpm="npm --registry=https://registry.npm.taobao.org \
--cache=$HOME/.npm/.cache/cnpm \
--disturl=https://npm.taobao.org/dist \
--userconfig=$HOME/.cnpmrc"

# Or alias it in .bashrc or .zshrc
$ echo '\n#alias for cnpm\nalias cnpm="npm --registry=https://registry.npm.taobao.org \
  --cache=$HOME/.npm/.cache/cnpm \
  --disturl=https://npm.taobao.org/dist \
  --userconfig=$HOME/.cnpmrc"' >> ~/.zshrc && source ~/.zshrc