Regular commands for brew
Brew update
This updates Homebrew itself. Keeping Homebrew current with the command brew update. Note, before running this command, it can take some time (if you haven't run it recently). It is highly recommended that you run the update before trying to install a package.
brew update
Response
Already up-to-date.
Brew doctor
Post running the brew update, next run a diagnostics command:
brew doctor
Response
Your system is ready to brew.
However, I was receiving
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
Brew upgrade
The first item to note is that this command can take some time to complete.
Now it is time to upgrade the brew packages rather than Homebrew. While brew update is for Homebrew itself. brew upgrade is for individual software packages. You won't need to bring software packages up to date until you need the latest versions, so you may not run this command often.
How do you install the newest version of a package:
brew upgrade <package>
Install the newest version of all packages:
brew upgrade
Brew list
If you want to review a complete list of all the packages you've installed:
brew list
You can also see a diagram of packages and dependencies.
brew deps --tree --installed
Errors
When running the command brew doctor, I was getting the following response
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Homebrew's "sbin" was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting your PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
To remove this error, I needed to run
sudo mkdir -p /usr/local/sbin
sudo chown -R $(whoami) /usr/local/sbin
Post running these two commands, the response is now:
Your system is ready to brew.