Linux系统设置镜像源

快捷命令:

sudo bash <(curl -sSL https://linuxmirrors.cn/main.sh)

详情参考https://linuxmirrors.cn/use/

Docker设置镜像源

快捷命令:

bash <(curl -sSL https://n3.ink/helper) config

详情参考https://1ms.run

编程语言三方库镜像源

Python设置Conda源和pip源

参考Conda方式安装Python

设置Go的镜像源

Linux

把下列代码放到.bashrc

export GO111MODULE=on
export GOPROXY=https://goproxy.cn,https://goproxy.io,https://mirrors.aliyun.com/goproxy/,https://athens.azurefd.net,https://sum.golang.org,direct

然后执行

source ~/.bashrc

Windows

手动设置一下环境变量GO111MODULEGOPROXY,内容参考上面

设置npm的镜像源

永久设置

1设置使用淘宝cnpm

npm config set registry https://registry.npmmirror.com

查看是否配置成功,成功后即可直接使用npm命令

npm config get registry

还原npm仓库

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

临时设置

npm install --registry=https://registry.npmmirror.com