由于众所周知的原因,Linux系统更新,开发人员下载安装包,依赖等的时候,慢的出奇,在这里列出一些国内常见的源以及一些配置方法。
常见源:
常用源的配置方法
Ubuntu配置
打开/etc/apt/sources.list
替换默认的http://archive.ubuntu.com为http://mirrors.aliyun.com
ubuntu 18.04(bionic) 配置如下
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
npm or yarn配置
npm配置方法
npm config set registry https://registry.npm.taobao.org
yarn配置方法
yarn config set registry https://registry.npm.taobao.org
测试配置是否成功
# npm 测试
npm config get registry
# yarn 测试
yarn config get registry
# 返回此内容说明配置成功
https://registry.npm.taobao.org
pypi配置
linux配置路径:~/.pip/pip.conf
windows配置路径:%HOMEPATH%\pip\pip.ini
添加或修改:
[global]
index-url = https://mirrors.aliyun.com/pypi/simple/
[install]
trusted-host=mirrors.aliyun.com