[Tool] HomeBrew

HomeBrew is a good tool and fill the final piece of the puzzle for me to switch from Linux to Mac.

Installation

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Usage

brew install <package>
brew uninstall <package>
brew list
brew search <package>
brew info <package>
brew update
brew upgrade
brew outdated
brew cleanup
brew doctor

Services

brew services list
brew services start <service>
brew services stop <service>
brew services restart <service>
brew services cleanup

Mirror

You can use a mirror to speed up the download, such as Aliyun.

# replace homebrew
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git

brew update

# replace homebrew-bottles
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.tuna.tsinghua.edu.cn/homebrew-bottles' >> ~/.zshrc

Reference

Categories: