天天看點

macOs Homebrew 記錄一次坑

記錄用Homebrew安裝軟體的一次坑

就以我安裝jenkins為例,根據官網的操作步驟,在terminal中執行brew install jenkins. 就這麼一個簡單步驟,讓我搗鼓了一下午才找到解決方案。正常來說執行完不報錯就OK了,可是我會報錯

tar: Error opening archive: Failed to open '/Users/c5328830/Library/Caches/Homebrew/downloads/e84711e684aa84f6ec13ed1100c6460f26f44ed0b2b2c70d23183647bfa4e758--openjdk@11-11.0.10.big_sur.bottle.tar.gz'
Error: Failure while executing; `tar --extract --no-same-owner --file /Users/c5328830/Library/Caches/Homebrew/downloads/e84711e684aa84f6ec13ed1100c6460f26f44ed0b2b2c70d23183647bfa4e758--openjdk@11-11.0.10.big_sur.bottle.tar.gz --directory /private/tmp/d20210810-19175-1wk7d6b` exited with 1. Here's the output:
tar: Error opening archive: Failed to open '/Users/c5328830/Library/Caches/Homebrew/downloads/e84711e684aa84f6ec13ed1100c6460f26f44ed0b2b2[email protected]_sur.bottle.tar.gz'
           

Google 百度都找不到相關解決方案。。。。

崩潰中。。。。

搜啊搜。

皇天不負有心人。。。

終于搜到了

原來我安裝homebrew的時候,使用的是國内鏡像版。。。。

是bintray要關閉了。

而Homebrew社群對這個其實是已經做了準備的,新版的homebrew程式已經去除了bintray相關,鏡像版,目前沒有解決。。。

解決辦法:

去掉國内鏡像的設定:export HOMEBREW_BOTTLE_DOMAIN=’’",這是臨時去除,如果要永久去除,修改配置檔案

zsh是~/.zprofile檔案,bash是 ~/.bash_profile檔案

bash要修改~/.bash_profile檔案

參考:https://www.tinkol.com/372

繼續閱讀