要用 Homebrew 前,自己的 OSX 上當然要先有 Homebrew 可用,執行以下指令即可完成安裝
```bash
# 安裝
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 解除安裝,若事後想要移除可執行以下指令
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall.sh)"
```
##**1\. 安裝、移除套件** ○ 安裝指定套件 `brew install`,以下 皆指套件名稱
○ 移除指定套件 `brew uninstall `
##**2\. 列出已安裝的套件** ○ 列出所有已安裝的套件 `brew leaves` ○ 列出所有已安裝的套件並包含其所有相依套件 `brew list` ○ 以樹狀圖方式列出所有已安裝的套件 `brew deps --tree $(brew leaves)` ***推薦*** ○ 以樹狀圖方式完整列出所有已安裝的套件(含所有相依套件) `brew deps --tree --installed` ○ 列出可更新的套件 `brew outdated`
##**3\. 查詢、更新套件** ○ 查詢指定套件線上的最新版本及資訊 `brew info`
○ 更新所有套件 `brew update && brew upgrade`
○ 更新指定套件 `brew upgrade `
##參考資料 [\[Homebrew\] Homebrew Documentation](https://docs.brew.sh/FAQ "Homebrew") [\[Stack Exchange\] List of all packages installed using Homebrew](https://apple.stackexchange.com/questions/101090/list-of-all-packages-installed-using-homebrew) [\[Stack Exchange\] How to know what packages are available with Homebrew](https://apple.stackexchange.com/questions/33354/how-to-know-what-packages-are-available-with-homebrew/33357)
##**1\. 安裝、移除套件** ○ 安裝指定套件 `brew install
##**2\. 列出已安裝的套件** ○ 列出所有已安裝的套件 `brew leaves` ○ 列出所有已安裝的套件並包含其所有相依套件 `brew list` ○ 以樹狀圖方式列出所有已安裝的套件 `brew deps --tree $(brew leaves)` ***推薦*** ○ 以樹狀圖方式完整列出所有已安裝的套件(含所有相依套件) `brew deps --tree --installed` ○ 列出可更新的套件 `brew outdated`
##**3\. 查詢、更新套件** ○ 查詢指定套件線上的最新版本及資訊 `brew info
##參考資料 [\[Homebrew\] Homebrew Documentation](https://docs.brew.sh/FAQ "Homebrew") [\[Stack Exchange\] List of all packages installed using Homebrew](https://apple.stackexchange.com/questions/101090/list-of-all-packages-installed-using-homebrew) [\[Stack Exchange\] How to know what packages are available with Homebrew](https://apple.stackexchange.com/questions/33354/how-to-know-what-packages-are-available-with-homebrew/33357)