/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install <package>
Install a formula or cask.
brew list
List all installed formulae and casks.
However, various required packages (dependencies) get automatically installed when installing a package using Homebrew. It is possible to view the list of all the installed packages as a nicely formatted dependency tree. To view it, execute the following command:
brew deps --tree --installed
Example output:
gdbm
openssl
python
βββ gdbm
βββ openssl
βββ readline
βββ sqlite
β βββ readline
βββ xz
readline
sqlite
βββ readline
brew leaves
(reference)
List installed formulae that are not dependencies of another installed formula.
will output a list of all manually? installed formulae -> we can infer that they are safe to uninstall without affecting the operating system
Example output:
ffmpeg
ilmbase
just
szip
vips
youtube-dl
brew uninstall <package>
(reference)
alias: brew remove <package>
/ brew rm <package>
Uninstall a formula or cask.
brew autoremove
Uninstall formulae that were only installed as a dependency of another formula and are now no longer needed.
useful after uninstalling a formulae
brew cleanup
Remove stale lock files and outdated downloads for all formulae and casks, and remove old versions of installed formulae. If arguments are specified, only do this for the given formulae and casks. Removes all downloads more than 120 days old. This can be adjusted with HOMEBREW_CLEANUP_MAX_AGE_DAYS.
brew update
Fetch the newest version of Homebrew and all formulae from GitHub using git(1) and perform any necessary migrations.
brew outdated
List installed casks and formulae that have an updated version available. By default, version information is displayed in interactive shells, and suppressed otherwise.
You can then either upgrade all outdated packages or specify a formula to be upgraded via
brew upgrade
| brew upgrade <formula>
Upgrade outdated casks and outdated, unpinned formulae using the same options they were originally installed with, plus any appended brew formula options.