Skip to main content

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.

 

Related articles

Andrew Fletcher13 Feb 2023
brew changing PHP versions on OSX
Installing PHP on OSX and it installed PHP 8.2.x. &nbsp;However, for my applications I need to run 8.1.x. &nbsp;How do you switch the current PHP version? &nbsp; Current version Check the current PHP version by executing the command php -v Response: PHP 8.2.2 (cli) (built: Feb ...
Andrew Fletcher05 Apr 2022
env: php: No such file or directory
In terminal I ran a regular command - compose update.&nbsp; Something I've completed thousands of times previously.&nbsp; However, this time I received the following response: env: php: No such file or directory &nbsp; What gives? Well, thinking through what had recently changed... The...