brew doctor: what its warnings mean and which ones to fix
Researched, not yet tested: read from Homebrew's source code (the main branch on 29 November 2026) and docs.brew.sh; we didn't run brew doctor on a Mac. Check the commands against your setup.
brew doctor checks your Homebrew setup and prints a warning for anything that might cause trouble. Most warnings include the fix. If it ends with:
Your system is ready to brew.
there’s nothing to do. If not, fix the warnings related to whatever is failing and ignore the rest. Homebrew’s help text for the command says the warnings mainly help maintainers debug issue reports, and that if everything you use Homebrew for is working fine, you can ignore them.
We haven’t run brew doctor on a Mac for this page. The warning text and fixes below come from the checks in Homebrew’s source code and its macOS checks, as of 29 November 2026. Wording can change between Homebrew releases.
Run it the right way
Homebrew’s troubleshooting checklist says to run brew update twice, then brew doctor, then retry the command that failed:
brew update
brew update
brew doctor
Two more options help:
brew doctor --list-checkslists every check by name.brew doctor <check_name>runs only that check, so you can confirm one fix without waiting for the rest.
brew doctor exits with a non-zero status when it finds anything, so a CI job that runs it will fail on warnings you’d normally ignore.
Common warnings and their fixes
| Warning (start of the message) | What it means | Fix | Fix it? |
|---|---|---|---|
Homebrew's "bin" was not found in your PATH. |
Your shell can’t find brew-installed commands | Add the brew shellenv line to ~/.zprofile (see below) |
Yes |
/usr/bin occurs before /opt/homebrew/bin in your PATH. |
Apple’s version of a tool runs instead of Homebrew’s | Move Homebrew’s bin earlier in PATH | If you rely on Homebrew’s versions |
Homebrew's "sbin" was not found in your PATH |
A formula put commands in sbin |
Add sbin to PATH using the line brew doctor prints |
If you use those commands |
You have unlinked kegs in your Cellar. |
Installed formulae aren’t linked into bin |
brew link <formula> for each one listed |
Yes, unless you unlinked them on purpose |
Broken symlinks were found: |
Links point to files that no longer exist | brew cleanup |
Yes, it’s safe |
Some installed formulae or casks are missing dependencies: |
A dependency was removed | brew install the names it lists |
Yes |
Some installed formulae are deprecated or disabled. |
The formula is being retired | Find a replacement, or brew uninstall it |
When convenient |
A newer Command Line Tools release is available. |
Apple’s developer tools are out of date | Update them (see below) | Yes |
Your Command Line Tools are too outdated. |
Builds from source may fail | Update or reinstall the tools | Yes |
The following directories are not writable by your user: |
Ownership changed, often after sudo brew |
Run the chown command it prints |
Yes |
Unbrewed dylibs were found in /usr/local/lib. |
Another installer put libraries there | Delete only files you know you don’t need | Only if builds fail |
Your Homebrew's prefix is not /opt/homebrew. |
Homebrew is installed in a custom place | Reinstall in the default place | Only if bottles won’t install |
You have the following deprecated, official taps tapped: |
Old Homebrew taps are still added | brew untap <name> |
Yes, it’s safe |
The prefix in the table is /opt/homebrew for Apple Silicon. On an Intel Mac it’s /usr/local.
Fix the PATH warnings
For “bin was not found in your PATH”, add Homebrew to your shell profile. On Apple Silicon:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"
For “/usr/bin occurs before … in your PATH”, look for a line in ~/.zshrc or ~/.zprofile that adds /usr/bin to the front of PATH, or one that runs after the brew shellenv line and resets PATH. The brew shellenv line should come after it. Open a new terminal to check. Our page on brew command not found covers the PATH setup in more detail.
Fix the Command Line Tools warnings
Update through Software Update in System Settings, or reinstall:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
Our guide to the Xcode Command Line Tools covers updating with softwareupdate and what to do when the tools break after a macOS update.
Fix the permission warnings without sudo
When brew doctor says directories aren’t writable, it prints a sudo chown -R command with your username and the exact folders. Run that command as printed. Don’t run sudo brew to get around permission errors. Homebrew is meant to run as your normal user, and running it as root is a common way these warnings start. The troubleshooting page also warns against applying ownership or permission changes from old issue reports without understanding which files they affect.
Warnings you can usually leave
Warnings about unbrewed libraries, headers or .pc files in /usr/local come from other installers (some apps and SDKs put files there). Homebrew’s text says they could cause problems when building formulae and “may need to be deleted” if you didn’t put them there on purpose. Leave them unless a build from source fails, and then check which program installed each file before you delete it.
If Homebrew itself is too broken to fix this way, uninstalling and reinstalling Homebrew is the clean option.
FAQ
What does brew doctor do?
It runs a list of checks on your Homebrew install (PATH order, folder permissions, broken links, outdated developer tools, missing dependencies) and prints a warning for each problem it finds, usually with the command that fixes it. It changes nothing itself.
Can I ignore brew doctor warnings?
Often, yes. Homebrew's own help text says the warnings are there to help maintainers debug issue reports, and that if everything you use Homebrew for works, you can ignore them. Fix the ones related to a command that's failing.
How do I run only one brew doctor check?
List the check names with brew doctor --list-checks, then pass one or more as arguments, for example brew doctor check_for_broken_symlinks. This is quicker when you're confirming a single fix.
Why does brew doctor exit with an error?
It exits with a non-zero status whenever it finds any potential problem, even a harmless one. Scripts that run brew doctor and stop on errors will stop on warnings too.
