PS:
操作系统:Linux
Linux系统包管理器
1 2 3 4 5 6 7 8
| bash <(curl -sSL https://linuxmirrors.cn/main.sh)
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --edu
bash <(curl -sSL https://linuxmirrors.cn/main.sh) --abroad
|
Pip国内源
源地址
配置方法
临时配置
1 2 3 4 5 6 7
| pip install {包名} -i {源地址URL} pip install pandas -i http://pypi.mirrors.ustc.edu.cn/simple/
pip install {包名} -i {源地址URL} --trusted-host {源地址} pip install pandas -i http://pypi.douban.com/simple --trusted-host pypi.douban.com
|
永久配置
1 2
| pip config --global set global.index-url http://pypi.douban.com/simple pip config --global set install.trusted-host pypi.douban.com
|
~/.pip/pip.conf
内容如下:
1 2 3 4
| [global] index-url = http://pypi.douban.com/simple [install] trusted-host=pypi.douban.com
|
Conda镜像源
1 2 3 4 5
| vim ~/.condarc
conda clean -i
|
~/.condarc
内容如下:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| channels: - defaults show_channel_urls: true default_channels: - http://mirrors.aliyun.com/anaconda/pkgs/main - http://mirrors.aliyun.com/anaconda/pkgs/r - http://mirrors.aliyun.com/anaconda/pkgs/msys2 custom_channels: conda-forge: http://mirrors.aliyun.com/anaconda/cloud msys2: http://mirrors.aliyun.com/anaconda/cloud bioconda: http://mirrors.aliyun.com/anaconda/cloud menpo: http://mirrors.aliyun.com/anaconda/cloud pytorch: http://mirrors.aliyun.com/anaconda/cloud simpleitk: http://mirrors.aliyun.com/anaconda/cloud
|
Npm
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| npm config get registry
npm config set registry https://registry.npm.taobao.org
npm config set registry http://mirrors.cloud.tencent.com/npm/
npm config set registry https://mirrors.huaweicloud.com/repository/npm/
npm config set registry https://registry.npmjs.org
|
Yarn 镜像源
1 2 3 4 5 6 7 8
| yarn config get registry
yarn config set registry https://registry.npmmirror.com
yarn config set registry https://registry.yarnpkg.com
|
Docker镜像源
源地址
配置方法
1
| docker pull {镜像名称} -–registry-mirror={国内镜像源地址}
|
1 2 3 4 5
| vim /etc/docker/daemon.json
sudo systemctl restart docker
|
/etc/docker/daemon.json
内容如下:
1 2 3 4 5 6 7
| { "registry-mirrors": [ ... "https://hub-mirror.c.163.com" ] }
|
参考资料