brew命令


下面參考下網友的總結:

 

查看brew的幫助

brew –help

安裝軟件

brew install git

卸載軟件

brew uninstall git

搜索軟件

brew search git

顯示已經安裝軟件列表

brew list

更新軟件,把所有的Formula目錄更新,並且會對本機已經安裝並有更新的軟件用*標明。

brew update

更新某具體軟件

brew upgrade git

查看軟件信息

brew [info | home] [FORMULA...]

刪除程序,和upgrade一樣,單個軟件刪除和所有程序老版刪除。

brew cleanup git 
brew cleanup

查看那些已安裝的程序需要更新

brew outdated

 

 

其它Homebrew指令:

brew list   —列出已安裝的軟件

brew update   —更新Homebrew

brew home  *—用瀏覽器打開

brew info   *—顯示軟件內容信息

brew deps * — 顯示包依賴

brew server *  —啟動web服務器,可以通過瀏覽器訪問http://localhost:4567/ 來同網頁來管理包

brew -h brew   —幫助

homebrew本身就是一個git倉庫。使用homebrew安裝軟件包時,會自動先下載軟件包,然后解壓安裝,但有時候下載會卡住,或者很慢,這個時候你可以通過其他工具先將所需的軟件包下載 下來,注意版本一定要對應,homebrew放置軟件包源碼的路徑為/Library/Caches/Homebrew/,只要你將所需要的軟件包下載正 確的版本,放置在此目錄下,那么再使用brew install xxx的時候,brew就能直接安裝了,有時候brew install xxx卡在下載界面,這招很管用。

 

Making a formula is easy. Just brew create URL and then brew install $FORMULA (perhaps with --debug --verbose). Basically, a formula is a Ruby file. You can place it anywhere you want (local or remote) and install it by pointing to the file or URL.

formula文件位置:/usr/local/Library/Formula/foo.rb  存放安裝工具的rb文件

Packages are installed according to their formulae, which live in $(brew --repository)/Library/Formula. Check some out. You can view any formula at anytime; e.g. brew edit wget.

 

 另 外說明下,brew安裝程序的過程中需要用到蘋果的xcode中的 編譯器,你可以到蘋果的官網中免費下載安裝(需要注冊免費的開發者,然后才能下載),安裝后到屬性(Xcode -- Perference--Downloads--Components--Command Line Tools)點擊下載就可以了

Homebrew工具地址:https://github.com/Homebrew/homebrew


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM