【macOS】【Homebrew】Homebrew基本教學

Homebrew是以ruby寫的。
Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple's macOS operating system and Linux.
Written by Max Howell, the package manager has gained popularity in the Ruby on Rails community and earned praise for its extensibility.

安裝Homebrew

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
意思是用 bash、crul,執行 https://raw.githubusercontent.com/Homebrew/install/master/install.sh 的腳本

看更多文件說明
$ brew help
$ man brew



安裝套件

brew install 套件名稱
$ brew install wget
brew tap 使用者/資源庫

用來追蹤trace、更新update github上的套件(當然,tap能做到的不只有追蹤github ,也可以追蹤特定URL)
brew tap <user>/<repo> makes a shallow clone of the repository at https://github.com/user/homebrew-repo.
$ brew tap homebrew/cask

如果brew tap沒有帶任何參數,則會自動更新所有已追蹤的資源庫
$ brew tap

列出已用brew安裝的套件
$ brew list
 已安裝的套件路徑在:
/usr/local/Cellar
/usr/local/opt

Homebrew Cask (釀酒桶?)

macOS的應用程式分為:有圖形介面的應用程式、以及命令列的工具,
Homebrew Cask 是 Homebrew 的子專案,主是用來安裝和管理有圖形化介面的應用程式,一些在App Store中找不到的應用程式可以透過Cask來安裝。
installation and management of GUI macOS applications

安裝Homebrew Cask

$ brew tap homebrew/cask$ brew install brew-cask-completion


之後就可以使用 brew cask 來安裝圖形應用程式了。


列出已用brew cask安裝的套件
$ brew cask list 

 已安裝的套件路徑在:
/usr/local/Caskroom