搜索軟件: brew search 軟件包名稱
安裝軟件: brew install 軟件包名稱
卸載軟件: brew uninstall 軟件包名稱
問題1 : curl: (7) Failed to connect to http://raw.githubusercontent.com port 443: Connection refused” 錯誤
解決方法:
打開 www.ipaddress.com 網(wǎng)站查詢 raw.githubusercontent.com 主機(jī)的真實(shí)IP
打開 /etc/hosts 文件,增加一條記錄
185.199.108.133 raw.githubusercontent.com
問題2 :如果 brew install 出以下錯誤, 則安裝時使用 arch -arm64 brew install 軟件包名 進(jìn)行安裝
Homebrew 安裝腳本會將程序默認(rèn)裝至 /usr/local/Homebrew ,這是 Intel 芯片架構(gòu)上的安裝路徑,M1芯片上則需要安裝到 /opt/Homebrew/ 下。
sudo mkdir -p /opt/homebrew sudo chown -R $(whoami) /opt/homebrew
下載 homebrew 包并解壓至 /opt/homebrew 目錄
curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
如果下載慢,可以直接通過 https://github.com/Homebrew/brew/tarball/master 或本地下載,copy 到 /opt 目錄下再將壓縮包解壓到 /opt/homebrew 目錄
cp /opt tar xz 壓縮包名 --strip 1 -C homebrew
將路徑增加到PATH環(huán)境變量中
vim ~/.bash_profile
#在 .bash_profile 中新增 export PATH=$PATH:/opt/homebrew/bin; #保存退出
#刷新生效 source ~/.bash_profile
修改源
cd "$(brew --repo)" git clone https://mirrors.ustc.edu.cn/brew.git cd "$(brew --repo)/Library/Taps/homebrew" git clone https://mirrors.ustc.edu.cn/homebrew-core.git git clone https://mirrors.ustc.edu.cn/homebrew-cask.git brew update #更新
其它鏡像地址:
HomeBrew 官方鏡像:
brew: https://github.com/Homebrew/brew
core: https://github.com/Homebrew/homebrew-core
cask: https://github.com/Homebrew/homebrew-cask清華大學(xué)鏡像:
brew: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/brew.git
core: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
cask: https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git中科大鏡像:
brew: https://mirrors.ustc.edu.cn/brew.git
core: https://mirrors.ustc.edu.cn/homebrew-core.git
cask: https://mirrors.ustc.edu.cn/homebrew-cask.git
終于可以進(jìn)行下載軟件了
brew install -s 軟件包名
到此這篇關(guān)于Mac M1安裝Homebrew的方法步驟的文章就介紹到這了,更多相關(guān)M1安裝Homebrew內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
標(biāo)簽:襄陽 雙鴨山 莆田 丹東 遵義 鄂爾多斯 哈爾濱 錫林郭勒盟
巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《Mac M1安裝Homebrew的方法步驟》,本文關(guān)鍵詞 Mac,安裝,Homebrew,的,方法,;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問題,煩請?zhí)峁┫嚓P(guān)信息告之我們,我們將及時溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無關(guān)。