如果出现什么连接拒绝的错
sudo vim /etc/hosts添加一些GitHub的主机名
:~|⇒ brew install wget Updating Homebrew... Error: No available formula with the name "wget" ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps. ~|⇒ brew search wget Warning: Cask 'copyq' is unreadable: undefined method `method_missing_message' for Utils:Module No formula or cask found for "wget". Closed pull requests: Add AirtestIDE 1.2.3 (https://github.com/Homebrew/homebrew-cask/pull/80297) Aflplusplus (https://github.com/Homebrew/homebrew-core/pull/50873) Add support for Whalebrew to bundle (https://github.com/Homebrew/homebrew-bundle/pull/656) hugo 0.69.0 (https://github.com/Homebrew/homebrew-core/pull/52816) Add SHA256 sum to keyboard-cleaner 1.2 cask (https://github.com/Homebrew/homebrew-cask/pull/78230) Fetch formula resources before unlinking during upgrade. (https://github.com/Homebrew/brew/pull/7124) Update .rubocop.yml (https://github.com/Homebrew/brew/pull/7258) bombadillo 2.3.1 (new formula) (https://github.com/Homebrew/homebrew-core/pull/54718) Skip tapping homebrew/cask when on Linux (https://github.com/Homebrew/homebrew-bundle/pull/660) osmfilter: adding zlib-dependency (https://github.com/Homebrew/linuxbrew-core/pull/20132) radamsa 0.6 (https://github.com/Homebrew/homebrew-core/pull/51125) Update skype from 8.55.0.141 to 8.56.0.103 (https://github.com/Homebrew/homebrew-cask/pull/76434) Fix accessibility issues (https://github.com/Homebrew/brew.sh/pull/441) wget: Build a bottle for Linux (https://github.com/Homebrew/linuxbrew-core/pull/17585) wget: revision for OpenSSL 1.1 (https://github.com/Homebrew/homebrew-core/pull/47071) wiredtiger 3.2.1 (https://github.com/Homebrew/homebrew-core/pull/51348) monolith 2.0.16 (new formula) (https://github.com/Homebrew/homebrew-core/pull/47033) libosinfo 1.7.1 (https://github.com/Homebrew/homebrew-core/pull/47460) Merge 2019-11-23 3c4768deeb (https://github.com/Homebrew/linuxbrew-core/pull/17575) WIP: Add KnightOS SDK (https://github.com/Homebrew/homebrew-core/pull/49912)报上面的错误的话 我的办法是修改镜像源 不然之前安装很慢
cd “$(brew --repo)” git remote set-url origin git://mirrors.ustc.edu.cn/brew.git
cd “$(brew --repo)/Library/Taps/homebrew/homebrew-core” git remote set-url origin git://mirrors.ustc.edu.cn/homebrew-core.git
brew update
brew install wget ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/gettext-0.20.2_1.catalina.b ######################################################################## 100.0% ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libunistring-0.9.10.catalin ######################################################################## 100.0% ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libidn2-2.3.0.catalina.bott ######################################################################## 100.0% ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl@1.1-1.1.1g.catali ######################################################################## 100.0% ==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/wget-1.20.3_2.catalina.bott ######################################################################## 100.0% ==> Installing dependencies for wget: gettext, libunistring, libidn2 and openssl@1.1 ==> Installing wget dependency: gettext ==> Pouring gettext-0.20.2_1.catalina.bottle.tar.gz 🍺 /usr/local/Cellar/gettext/0.20.2_1: 1,923 files, 18.6MB ==> Installing wget dependency: libunistring ==> Pouring libunistring-0.9.10.catalina.bottle.tar.gz 🍺 /usr/local/Cellar/libunistring/0.9.10: 54 files, 4.4MB ==> Installing wget dependency: libidn2 ==> Pouring libidn2-2.3.0.catalina.bottle.tar.gz 🍺 /usr/local/Cellar/libidn2/2.3.0: 70 files, 727.8KB ==> Installing wget dependency: openssl@1.1 ==> Pouring openssl@1.1-1.1.1g.catalina.bottle.tar.gz ==> Caveats A CA file has been bootstrapped using certificates from the system keychain. To add additional certificates, place .pem files in /usr/local/etc/openssl@1.1/certs and run /usr/local/opt/openssl@1.1/bin/c_rehash openssl@1.1 is keg-only, which means it was not symlinked into /usr/local, because macOS provides LibreSSL. If you need to have openssl@1.1 first in your PATH run: echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc For compilers to find openssl@1.1 you may need to set: export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" ==> Summary 🍺 /usr/local/Cellar/openssl@1.1/1.1.1g: 8,059 files, 18MB ==> Installing wget ==> Pouring wget-1.20.3_2.catalina.bottle.tar.gz 🍺 /usr/local/Cellar/wget/1.20.3_2: 50 files, 4.0MB ==> Caveats ==> openssl@1.1 A CA file has been bootstrapped using certificates from the system keychain. To add additional certificates, place .pem files in /usr/local/etc/openssl@1.1/certs and run /usr/local/opt/openssl@1.1/bin/c_rehash openssl@1.1 is keg-only, which means it was not symlinked into /usr/local, because macOS provides LibreSSL. If you need to have openssl@1.1 first in your PATH run: echo 'export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"' >> ~/.zshrc For compilers to find openssl@1.1 you may need to set: export LDFLAGS="-L/usr/local/opt/openssl@1.1/lib" export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include"出现这样就算成功了 速度还是很快的