Brew 鏡像源以及使用Homebrew應(yīng)用在MacOS。
Brew 鏡像源以及使用
Homebrew應(yīng)用在MacOS。
1.1 查看當(dāng)前鏡像源的信息
# 查看brew鏡像源
git -C "$(brew --repo)" remote -v
# 查看homebrew-core鏡像源
git -C "$(brew --repo homebrew/core)" remote -v
# 查看homebrew-cask鏡像源(需要安裝后才能查看)
git -C "$(brew --repo homebrew/cask)" remote -v
執(zhí)行 brew 命令安裝應(yīng)用的時候,跟以下 3 個倉庫地址有關(guān)。
brew.git (源代碼倉庫)
homebrew-core.git (核心軟件倉庫)
homebrew-bottles (預(yù)編譯二進制軟件包)
1.2 修改為中科大鏡像源
# 修改brew鏡像源
git -C "$(brew --repo)" remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 修改homebrew-core鏡像源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 修改homebrew-cask鏡像源(需要安裝后才能修改)
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.ustc.edu.cn/homebrew-cask.git
# 更新
brew update
或者
# 進到目錄,更改鏡像源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git
# 進到目錄,更改鏡像源
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
# 修改.bash_profile配置信息,并使文件生效
source ~/.base_profile
# 測試更新
brew update
參考地址:https://lug.ustc.edu.cn/wiki/mirrors/help/homebrew-bottles
1.3 修改為阿里云鏡像源
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git
# 別忘記更新配置文件,并生效配置文件
source ~/.base_profile
# 測試更新
brew update
1.4 清華大學(xué)鏡像源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-core.git
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask.git
git -C "$(brew --repo homebrew/cask-fonts)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-fonts.git
git -C "$(brew --repo homebrew/cask-drivers)" remote set-url origin https://mirrors.tuna.tsinghua.edu.cn/git/homebrew/homebrew-cask-drivers.git
# 別忘記更新配置文件,并生效配置文件
source ~/.base_profile
# 測試更新
brew update
參考地址:https://mirrors.tuna.tsinghua.edu.cn/help/homebrew/
1.5恢復(fù)默認(rèn)設(shè)置鏡像源
# 恢復(fù)brew鏡像源
git -C "$(brew --repo)" remote set-url origin https://github.com/Homebrew/brew.git
# 恢復(fù)homebrew-core鏡像源
git -C "$(brew --repo homebrew/core)" remote set-url origin https://github.com/Homebrew/homebrew-core.git
# 恢復(fù)homebrew-cask鏡像源(需要安裝后才能修改)
git -C "$(brew --repo homebrew/cask)" remote set-url origin https://github.com/Homebrew/homebrew-cask.git
brew update
1.6 更改配置文件
### aliyun io
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles
### 中科大 io
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles
### 清華大學(xué) io
# export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles
1.7 brew 常用命令
命令 說明
brew –help #查看brew的幫助
brew install git #安裝git軟件
brew uninstall git #卸載git軟件
brew search git #搜索git軟件
brew list #顯示已經(jīng)安裝軟件列表
brew update #更新軟件,把所有的Formula目錄更新,并且會對本機已經(jīng)安裝并有更新的軟件用*標(biāo)明。
brew upgrade git #更新某具體軟件
brew [info|home] [FORMULA…] #查看軟件信息
brew cleanup git #單個軟件刪除,和upgrade一樣
brew cleanup #刪除所有
brew outdated #查看那些已安裝的程序需要更新
brew home * #用瀏覽器打開
brew info * #顯示軟件內(nèi)容信息
brew deps * #顯示包依賴
brew config #查看brew配置
————————————————
版權(quán)聲明:本文為CSDN博主「六月暴雪飛梨花」的原創(chuàng)文章,遵循CC 4.0 BY-SA版權(quán)協(xié)議,轉(zhuǎn)載請附上原文出處鏈接及本聲明。
原文鏈接:https://blog.csdn.net/L_Lycos/article/details/113680436
來源:本文內(nèi)容搜集或轉(zhuǎn)自各大網(wǎng)絡(luò)平臺,并已注明來源、出處,如果轉(zhuǎn)載侵犯您的版權(quán)或非授權(quán)發(fā)布,請聯(lián)系小編,我們會及時審核處理。
聲明:江蘇教育黃頁對文中觀點保持中立,對所包含內(nèi)容的準(zhǔn)確性、可靠性或者完整性不提供任何明示或暗示的保證,不對文章觀點負(fù)責(zé),僅作分享之用,文章版權(quán)及插圖屬于原作者。
Copyright?2013-2024 JSedu114 All Rights Reserved. 江蘇教育信息綜合發(fā)布查詢平臺保留所有權(quán)利
蘇公網(wǎng)安備32010402000125
蘇ICP備14051488號-3技術(shù)支持:南京博盛藍睿網(wǎng)絡(luò)科技有限公司
南京思必達教育科技有限公司版權(quán)所有 百度統(tǒng)計