Homebrew is a package manager for Mac OS. It lets you download binaries, packages, and applications with a single command.

Homebrew is a package manager for Mac OS. It lets you download binaries, packages, and applications with a single command.

安装Homebrew

1
2
# Installs Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

升级Homebrew

1
2
# Updates Homebrew
brew update

搜索包

1
brew seach tree

安装包

1
2
3
4
5
# Install Package
brew install <formula>

# For Example
brew install tree

升级包

1
2
3
4
5
6
7
8
# Upgrades one package to the latest version
brew upgrade <formula>

# Upgrades all packages to their latest version
brew upgrade

# For Example
brew upgrade tree

删除包

1
2
3
4
brew uninstall <formula>

# For Example
brew uninstall tree

清理空间

1
brew cleanup

Brew Tap

homebrew/core维护一份可用包列表,在你执行brew install 命令时都是从这个列表进行安装的。

如果需要安装是一个第三方的包列表就需要我们使用brew tap命令来将此列表添加新homebrew/core列表中

1
2
3
4
5
6
# For Example
# Required to install MongoDB with Homebrew
brew tap mongodb/brew

# Installs MongoDB
brew install mongodb-community

Brew Cask

homebrew/cask可以安装GUI程序, 如: Chrome, Vscode, Atom等

1
2
3
4
5
6
7
# 获取brew cask
brew tap caskroom/cask
brew install brew-cask

# Installs Google Chrome
brew cask install google-chrome
brew cask install visual-studio-code

声明: 本文只作学习用途,如有侵权请及时联系Chui Dylan删除,谢谢!!!