转:一站配齐所有国内镜像

npmyarn pythonhomebrew镜像加速

发布于 7月19日

开发过程中,我们经常会用到各种各样的包管理工具,几乎每种包管理工具缺省设置都是从国外服务器下载相应的软件安装包,或者下载很慢,或者干脆无法下载。以下列出我常用的所有国内镜像,方便有类似需求的同学参考(不定期更新,感觉有用的同学请注意收藏)

我平常用的shellfish,所以下面的语法全都是fish相关的set -x,如果是用缺省的bash,可以替换成export命令。

操作系统相关

brew国内镜像

cd /usr/local/Homebrew
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
cd /usr/local/Homebrew/Library/Taps/homebrew/homebrew-cask
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# brew国内镜像
set -x HOMEBREW_BOTTLE_DOMAIN https://mirrors.ustc.edu.cn/homebrew-bottles

Javascript相关

npm国内镜像

npm config set registry https://registry.npm.taobao.org/

yarn国内镜像

yarn config set registry https://registry.npm.taobao.org/

pnpm国内镜像

pnpm config set registry https://registry.npm.taobao.org/

electron国内镜像

set -x ELECTRON_MIRROR http://npm.taobao.org/mirrors/electron/

node-sass国内镜像

set -x SASS_BINARY_SITE https://npm.taobao.org/mirrors/node-sass/

fsevents国内镜像

set -x FSE_BINARY_HOST_MIRROR https://npm.taobao.org/mirrors/fsevents/

更多

更多设置,或者懒得一个一个设置的同学也可以参考这里:

https://gist.github.com/hetyk...点击预览

把这些代码下载到一个shell脚本里,一键添加完成。

Python相关

pip国内镜像

$ cat ~/.pip/pip.conf
[global]
index-url=https://pypi.tuna.tsinghua.edu.cn/simple

conda国内镜像

conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/
conda config --set show_channel_urls yes

PHP相关

composer国内镜像

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

其它语言

flutter国内镜像

set -x PUB_HOSTED_URL https://pub.flutter-io.cn
set -x FLUTTER_STORAGE_BASE_URL https://storage.flutter-io.cn

补充

github国内镜像

如果是在git clone时遇到了问题,可以先在码云建立一个库,来源取自github,然后同步码云这个库即可。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值