软件及各开发语言镜像和加速源2022版

像Docker、Golang、PHP、Node、Java、Rust等各种加速源经常需要更换,有的源地址也进行了升级,整理了截止2022年10月最新最快的源地址

Rust crates.io 镜像

使用头条镜像 https://rsproxy.cn/

crates.io 镜像

vi ~/.cargo/config

[source.crates-io]
# To use sparse index, change 'rsproxy' to 'rsproxy-sparse'
replace-with = 'rsproxy'

[source.rsproxy]
registry = "https://rsproxy.cn/crates.io-index"
[source.rsproxy-sparse]
registry = "sparse+https://rsproxy.cn/index/"

[registries.rsproxy]
index = "https://rsproxy.cn/crates.io-index"

[net]
git-fetch-with-cli = true

Rustup 镜像

vi ~/.zshrc

export RUSTUP_DIST_SERVER="https://rsproxy.cn"
export RUSTUP_UPDATE_ROOT="https://rsproxy.cn/rustup"

PHP Composer

Composer安装: https://getcomposer.org/download/

推荐阿里云加速地址: https://mirrors.aliyun.com/composer/ 不推荐 https://pkg.xyz/

官方说明: https://developer.aliyun.com/composer

全局安装

composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

或项目代码库修改 composer.json

    "repositories": [
        {
            "type": "composer",
            "url": "https://mirrors.aliyun.com/composer/"
        }
    ]

Golang GOPROXY

加速地址:https://goproxy.cn/

设置办法

echo "export GO111MODULE=on" >> ~/.profile
echo "export GOPROXY=https://goproxy.cn" >> ~/.profile
source ~/.profile

npm registry

加速地址:

官网说明: https://npmmirror.com/

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

设置目录权限

sudo chmod -R 777 ~/.npm
sudo chmod -R 777 /usr/local/lib/node_modules

Docker 阿里云镜像加速器

阿里云容器镜像服务 https://cr.console.aliyun.com/

选择 “镜像工具”->“镜像加速器”,配置自己的镜像地址,镜像地址格式为 https://xxx.mirror.aliyuncs.com 每个账号的地址都是单独的。

Java maven源

阿里maven说明: https://maven.aliyun.com

maven源地址: https://maven.aliyun.com/repository

Mac brew

安装 Homebrew: https://brew.sh/index_zh-cn

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

阿里云加速源: https://developer.aliyun.com/mirror/homebrew

Python pip

使用说明: https://mirrors.tuna.tsinghua.edu.cn/help/pypi/

python -m pip install --upgrade pip
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple