Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer
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
It could be in either ~/.profile, ~/.bash_profile, ~/.bash_login, or ~/.bashrc already. – Jason Salaz Dec 4 '12 at 8:56

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.