Homebrew 与系统包管理器

brew、apt、dnf 的代理设置。

Homebrew(macOS / Linux)

Homebrew 使用 curl 下载,读取环境变量:

bash
export ALL_PROXY=http://127.0.0.1:7898
brew update && brew install <formula>

apt(Debian / Ubuntu)

bash
echo 'Acquire::http::Proxy "http://127.0.0.1:7898";
Acquire::https::Proxy "http://127.0.0.1:7898";' | sudo tee /etc/apt/apt.conf.d/95coderboost

系统软件源通常已经配置为就近的镜像,一般不需要为 apt 设置代理。只有 PPA、第三方源(如 Docker、NodeSource 的官方源)才需要。

dnf / yum

/etc/dnf/dnf.conf:

ini
proxy=http://127.0.0.1:7898