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
```sh
/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):
```sh
brew install formula
```
List all installed formulae and casks:
```sh
brew list
```
Upgrade an installed package
```sh
brew upgrade formula
```
Fetch the newest version of Homebrew
```sh
brew update
```
Show outdated formulae and casks
```sh
brew outdated
```
Search for available packages
```sh
brew search text
```
* Display information about a package
```sh
brew info formula
```
Check the local Homebrew installation for potential problems:
```sh
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.
```sh
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. ```sh
brew create --cask download-url --set-name my-new-cask
```
2. Fill in the blanks.
3. Profit?!
```sh
brew create <URL>
```
Create a SHA256 hash of a file with the following command:
```ruby
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
```
```sh
brew audit --strict vero
```
Fork: <https://github.com/Homebrew/homebrew-cask>
```sh
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.
```sh
# 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].
```sh
brew livecheck vero
```
# References
* [https://brew.sh/]
* [Contributing a Homebrew Cask]
* [Adding Software to Homebrew]
[dive deeper into Homebrew installation details]: https://github.com/Homebrew/homebrew-cask/blob/master/USAGE.md
[my vero example]: https://github.com/Homebrew/homebrew-cask/pull/138010
[https://brew.sh/]: https://brew.sh/
[contributing a homebrew cask]: https://github.com/Homebrew/homebrew-cask/blob/HEAD/CONTRIBUTING.md
[adding software to homebrew]: https://docs.brew.sh/Adding-Software-to-Homebrew
[auto update homebrew formulas]: https://github.com/Homebrew/homebrew-autoupdate
[Brew Livecheck]: https://docs.brew.sh/Brew-Livecheck
[The Livecheck Strategy]: https://rubydoc.brew.sh/Homebrew/Livecheck/Strategy.html