Brainstorm's snippets (1/247)

  Homebrew Cheatsheet

Homebrew cheatsheet

Commands

brew install git Install a package
brew uninstall git Remove/Uninstall a package
brew upgrade git Upgrade a package
brew unlink git Unlink
brew link git Link
brew switch git 2.5.0 Change versions
brew list --versions git See what versions you have

More package commands

brew info git List versions, caveats, etc
brew cleanup git Remove old versions
brew edit git Edit this formula
brew cat git Print this formula
brew home git Open homepage
brew search git Search for formulas

Global commands

brew update Update brew and cask
brew list List installed
brew outdated What’s due for upgrades?
brew doctor Diagnose brew issues

Brew Cask commands

brew cask install firefox Install the Firefox browser
brew cask list List installed applications

(*) Cask commands are used for interacting with graphical applications.

Credits:

https://devhints.io/homebrew

See also:

Uninstalling homebrew

From https://osxdaily.com/2018/08/12/how-uninstall-homebrew-mac/:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

From https://apple.stackexchange.com/questions/82807/how-to-cleanly-remove-homebrew#82808:

cd /tmp
cd `brew --prefix`
rm -rf Cellar
brew prune
rm `git ls-files`
rm -r Library/Homebrew Library/Aliases Library/Formula Library/Contributions
rm -rf .git
rm -rf ~/Library/Caches/Homebrew

Homebrew Multi User Setup

From https://medium.com/@leifhanack/homebrew-multi-user-setup-e10cb5849d59:

  • Create a group brew and add Stan
  • brew doctor (Allen checks if he installed brew correctly)
  • sudo chgrp -R brew $(brew --prefix)/* (Change the group of homebrew installation directory)
  • sudo chmod -R g+w $(brew --prefix)/* (Allow group members to write inside this directory)
  • brew doctor (Stan checks if he can use homebrew)
  • We are done!