Homebrew is the best package manager ever created!

I’m serious; fight me! πŸ‘Š

Let’s get cracking and learn how to install, use, auto update, and contribute to Homebrew.

Installation

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

You may want to dive deeper into Homebrew installation details.

Usage

Install the latest stable version of a formula or cask (use --devel for development versions):

brew install formula

List all installed formulae and casks:

brew list

Upgrade an installed package

brew upgrade formula

Fetch the newest version of Homebrew

brew update

Show outdated formulae and casks

brew outdated

Search for available packages

brew search text
  • Display information about a package
brew info formula

Check the local Homebrew installation for potential problems:

brew doctor

Auto-Updating Homebrew

I auto update Homebrew formulas because I like to live on the edge. If you have trust issues, you can skip this section.

The Homebrew autoupdate tap provides a command to automatically update Homebrew, formulae, and casks. It is designed to be run regularly as a scheduled background job and will update the default Homebrew installation.

brew tap homebrew/autoupdate
brew autoupdate --start --upgrade --cleanup --enable-notification

Create a Cask

Creating a Cask is easy. Let’s go!

Grab the download URL from the website. In this case, it’s https://vero.co/download/desktop/beta/macos.

  1. brew create --cask download-url --set-name my-new-cask
    
  2. Fill in the blanks.

  3. Profit?!

brew create <URL>

Create a SHA256 hash of a file with the following command:

cask "vero" do
  version "0.5.4"
  sha256 :no_check

  url "https://vero.co/download/desktop/beta/macos"
  name "vero"
  desc "Ad-free, Algorithm-free Social."
  homepage "https://vero.co/"

  livecheck do
    url "https://vero.co/download/desktop/beta/macos"
    strategy :header_match
  end

  app "VERO.app"

  zap trash: [
    "~/Library/Application Support/VERO",
    "~/Library/Preferences/co.vero.desktop.plist",
    "~/Library/Saved Application State/co.vero.desktop.savedState",
  ]
end
brew audit --strict vero

Fork: https://github.com/Homebrew/homebrew-cask

cd "$(brew --repository homebrew/cask)"
brew audit --new-cask vero
brew install --cask  vero
brew uninstall --cask vero
# Reinstall when you're done!

If you have the gh command.

# If you have the gh command.
gh repo fork Homebrew/homebrew-cask
git checkout -b add-vero
git add *
git commit -m "add vero"
git push -u origin add-vero
# Post PR approval
git checkout master

Follow my vero example if you like.

Use Brew Livecheck to check for available updates and understand the Livecheck Strategy.

brew livecheck vero

References