又是套娃解決問題的一次經(jīng)歷
macOS版本:10.15.6
1 wget issue
使用wget發(fā)現(xiàn)MacBook上沒有也祠,并提示
-bash: wget: command not found
- 解決方法
- 先安裝Homebrew: Homebrew
- 然后再
brew install wget
即可挠说。
2 安裝homebrew issue
進(jìn)入homebrew主頁按照步驟安裝搏屑,提示connection 有問題
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
curl: (7) Failed to connect to raw.githubusercontent.com port 443: Connection refused
為了解決這個報錯,我試了幾個辦法免胃,比如:
- 查詢 raw.githubusercontent.com對應(yīng)的IP 地址音五,替換host文件。失敗啦~
- 執(zhí)行
sudo gem install redis
羔沙,然后再執(zhí)行/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
躺涝。失敗啦~ - 使用國內(nèi)的鏡像地址,成功啦撬碟!
執(zhí)行/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
3 brew install issue
再運行brew install wget
發(fā)現(xiàn)還是有error诞挨,會報
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/gettext-0.21.catalina.bottle.tar.gz
==> Downloading from https://homebrew.bintray.com/gettext-0.21.catalina.bottle.tar.gz
-=O#- # # #
curl: (22) The requested URL returned error: 404 Not Found
Trying a mirror...
==> Downloading https://ghcr.io/v2/homebrew/core/gettext-0.21.catalina.bottle.tar.gz
==> Downloading from https://github.com/-/v2/packages/container/package/homebrew%2Fcore%2Fgettext-0.21.catalina.bottle.tar.gz
#=#=-# #
curl: (22) The requested URL returned error: 404
Error: Failed to download resource "gettext"
Download failed: https://ghcr.io/v2/homebrew/core/gettext-0.21.catalina.bottle.tar.gz
明天繼續(xù)更新。呢蛤。。棍郎。其障。。
2021-04-14 Update
運行brew config
涂佃,得到一行關(guān)鍵信息:
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles
這個地址是錯誤的励翼,所以install任何包都會報404 error。
我查閱了Homebrew Bottles 源使用幫助辜荠,正確的地址是:
https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/
因此解決辦法就是更改環(huán)境變量汽抚,把HOMEBREW_BOTTLE_DOMAIN改正確就可以啦~Homebrew Bottles 源使用幫助里面的方法也很清晰。
我運行了下面這一行命令:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles/bottles' >> ~/.zshrc
source ~/.zshrc
不放心的話再運行一次brew config
看一眼伯病,此時發(fā)現(xiàn)已經(jīng)改對啦~
HOMEBREW_BOTTLE_DOMAIN: https://mirrors.ustc.edu.cn/homebrew-bottles/bottles
4 安裝wget成功??
最后運行brew install wget
造烁。得到很可愛的啤酒杯??,就可以一起干杯啦??午笛。
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/libidn2-2.3.0.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/openssl%401.1-1.1.1k.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Downloading https://mirrors.ustc.edu.cn/homebrew-bottles/bottles/wget-1.21.1.catalina.bottle.tar.gz
######################################################################## 100.0%
==> Installing dependencies for wget: libunistring, libidn2 and openssl@1.1
==> 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, 728KB
==> Installing wget dependency: openssl@1.1
....
==> Summary
?? /usr/local/Cellar/openssl@1.1/1.1.1k: 8,071 files, 18.5MB
==> Installing wget
==> Pouring wget-1.21.1.catalina.bottle.tar.gz
?? /usr/local/Cellar/wget/1.21.1: 88 files, 4MB
==> Caveats
==> openssl@1.1