国内源

各种源

清华源
腾讯源
阿里源

替换命令:sed -i 's/archive.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

Gradle

repositories {
    maven { url 'https://maven.aliyun.com/repository/public/' }
    mavenCentral()
}

Maven

settings.xml

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 https://maven.apache.org/xsd/settings-1.0.0.xsd">
  <localRepository />
  <interactiveMode />
  <offline />
  <pluginGroups />
  <servers />
  <mirrors>
    <mirror>
      <id>aliyunmaven</id>
      <mirrorOf>central</mirrorOf>
      <name>aliyun maven</name>
      <url>https://maven.aliyun.com/repository/public </url>
    </mirror>
  </mirrors>
  <proxies />
  <profiles />
  <activeProfiles />
</settings>

Go

参考资料

Go 1.13 及以上(推荐)

go env -w GOPROXY=https://goproxy.cn,direct

NPM

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

electron

ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/ npm install -g electron
ELECTRON_BUILDER_BINARIES_MIRROR=http://npm.taobao.org/mirrors/electron-builder-binaries/ electron-builder build

或者在.npmrc中添加

ELECTRON_MIRROR=http://npm.taobao.org/mirrors/electron/
ELECTRON_BUILDER_BINARIES_MIRROR=http://npm.taobao.org/mirrors/electron-builder-binaries/

pip

#设为默认
pip config set global.index-url https://mirrors.cloud.tencent.com/pypi/simple
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple

# 临时使用
pip install -i https://mirrors.cloud.tencent.com/pypi/simple <some-package>
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple some-package
pip install -i https://mirrors.aliyun.com/pypi/simple some-package

pip.conf文件中:

[global]
index-url = http://mirrors.aliyun.com/pypi/simple/  # 根据需要选清华源或者阿里源
[install]
trusted-host=mirrors.aliyun.com

Leave a Comment

Back to Top