国内源汇总
参考国内镜像站汇总
Ubuntu换源
以Ubuntu20.04更换北外源为例
软件源配置文件是/etc/apt/sources.list
。将该文件备份,然后将文件内容替换为以下内容
deb https://mirrors.bfsu.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-security main restricted universe multiverse
conda换源
以更换北外源为例
修改用户目录下的.condarc
文件为以下内容
channels:
- defaults
show_channel_urls: true
default_channels:
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/main
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/r
- https://mirrors.bfsu.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.bfsu.edu.cn/anaconda/cloud
msys2: https://mirrors.bfsu.edu.cn/anaconda/cloud
bioconda: https://mirrors.bfsu.edu.cn/anaconda/cloud
menpo: https://mirrors.bfsu.edu.cn/anaconda/cloud
pytorch: https://mirrors.bfsu.edu.cn/anaconda/cloud
simpleitk: https://mirrors.bfsu.edu.cn/anaconda/cloud
清除之前的索引缓存,保证用的是镜像站提供的索引
conda clean -i
pip换源
以更换北外源为例
临时使用
pip install -i https://mirrors.bfsu.edu.cn/pypi/web/simple some-package
设为默认
升级 pip 到版本 (>=10.0.0) 后进行配置:
pip install pip -U
pip config set global.index-url https://mirrors.bfsu.edu.cn/pypi/web/simple