This is the first day of my participation in the August More text Challenge. For details, see: August More Text Challenge.

what and why

When you open Homebrew’s website, the first thing you see is:

The Missing Package Manager for macOS (or Linux)

That is, Homebrew is the missing package manager on macOS, just like Yum, APT, etc. on Linux. It allows you to centrally manage your packages from the command line, without having to jump back and forth between the AppStore and various websites. Search, install, uninstall, and update operations can be performed through the command line interface.

The core concept

The logo on Homebrew’s website is a glass of wine. Brew means brew. Some of Homebrew’s core concepts are related to brewing.

Formula (formula)

The installation package description file is actually a Ruby file

Celler (cellar)

All installation packages will be installed in this directory

Keg (barrel)

Celler subdirectory. There are buckets in the cellar

Bottle (bottle)

The formula has been compiled

Cask (barrel)

Typically apps with graphical interfaces, like those in the AppStore

Tap (tap)

Download source for Formula

The installation

When I installed, I used the domestic image, because even if THE VPN was opened, the installation method provided by the official website also failed to install. Since I didn’t record the process when I installed it, I wrote this post later, so I’ll skip the process and run the following command, but just follow the prompts.

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Copy the code

Common commands

Install service class, command line software, Brew install --cask [package name] # Brew uninstall [package name] # Brew Search Brew home [package name] brew home [package name] brew update brew home [package name] brew update brew home [package name] brew update brew home [package name] brew update brew home [package name] brew update brew home Brew cleanup # Brew cleanup # Brew cleanup # Brew cleanup # Brew cleanup # Brew cleanup # brew cleanup # Brew cleanup Brew tap [tap name] brew tap [tap name] brew tap [tap name] brew tap Brew Services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services restart brew services Brew Services run [Service name]Copy the code

As an extra note, while learning Homebrew, I found that the online tutorial gave the brew Cask install command, but I used the prompt cask command does not exist, and the official website also provides the cask parameter form.