When I run brew doctor I get this warning:

Warning: /usr/bin occurs before /usr/local/bin

TONS of people with the same problem, but they solve it by running this:


Which fixes it once, but upon closing the terminal windows and opening a new one and running brew doctor, the warning re-appears.

Is there a permanent fix for this?


Edit your PATH variable in your ~/.profile (assuming you have not changed your default login shell). There should be something like this:

export PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin

change it so that /usr/local/bin in before /usr/bin.

If you do not have a ~/.profile (or it is empty) type the following:

echo 'export PATH=$PATH' >> ~/.profile,

Make certain that you use >> instead of one >.

Now edit the ~/.profile like described before.

  • My .profile file is empty upon entering sudo nano ~/.profile
    – alt
    Dec 4 '12 at 7:16
  • added more information @JacksonGariety
    – Pfitz
    Dec 4 '12 at 7:26
  • Thanks! So my .profile now looks like this and it's saved: export PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/X11/bin But it gives me the same error. Is a restart needed here?
    – alt
    Dec 4 '12 at 7:30
  • close and reopen the Teminal
    – Pfitz
    Dec 4 '12 at 7:35
  • 1
    It could be in either ~/.profile, ~/.bash_profile, ~/.bash_login, or ~/.bashrc already. Dec 4 '12 at 8:56

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .