You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

$PATHS When did Apple add /usr/local/bin/ to private/etc/paths?

Years ago I added /usr/local/bin myself to .bash_profile.


I noticed recently that I had a duplicate in my PATH and it's /usr/local/bin. I am guessing Apple made this change recently?


I removed it— but curious:

  1. When did this take effect?
  2. What are the default contents and order of /private/etc/paths on a fresh macOS system?


Thanks!


iMac 27", macOS 10.14

Posted on Apr 8, 2020 12:55 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 8, 2020 2:08 PM

My old El Capitan system was the beginning of the /usr/local/bin as the last entry in /etc/paths, and everything since has followed that configuration including Catalina 10.15.4.


Here is a case in point. I installed the Command Line tools for Xcode 11 in Catalina. It turns out that for the first time, Apple installs an outdated, and thinned /usr/bin/python3. I also happen to deliberately install Python 3.8.2 from Python.org, which links its binaries into /usr/local/bin/python3, pip3, idle3, etc. This is why I have to explicitly avoid Apple's Python3 by prefacing my PATH with /usr/local/bin. If I didn't do this, then #!/usr/bin/env python3 would pick up Apple's junk Python.

Similar questions

4 replies
Question marked as Top-ranking reply

Apr 8, 2020 2:08 PM in response to johnnyjackhammer

My old El Capitan system was the beginning of the /usr/local/bin as the last entry in /etc/paths, and everything since has followed that configuration including Catalina 10.15.4.


Here is a case in point. I installed the Command Line tools for Xcode 11 in Catalina. It turns out that for the first time, Apple installs an outdated, and thinned /usr/bin/python3. I also happen to deliberately install Python 3.8.2 from Python.org, which links its binaries into /usr/local/bin/python3, pip3, idle3, etc. This is why I have to explicitly avoid Apple's Python3 by prefacing my PATH with /usr/local/bin. If I didn't do this, then #!/usr/bin/env python3 would pick up Apple's junk Python.

Apr 8, 2020 1:29 PM in response to johnnyjackhammer

I think Apple made this change back in El Capitan. Sent them a bug report and they told me to go pound sand as they had already decided on this change that did not exist in OS X previously. The last entry in /etc/paths is /usr/local/bin now.


If you have installed something in /usr/local/bin that has a name collision with anything installed by Apple in the other paths, then it is necessary to deliberately place /usr/local/bin before the default PATH contents, even though this is redundant.

Apr 8, 2020 2:41 PM in response to VikingOSX

This must be when SIP was introduced? Hard to believe I missed that for all of these years.


For posterity...


The default entries in /private/etc/paths in El Capitan, Sierra, High Sierra, Mojave, Catalina and newer are:

/usr/bin
/bin
/usr/sbin
/sbin
/usr/local/bin


The default entries in /private/etc/paths for Mavericks and earlier was:

/usr/bin
/bin
/usr/sbin
/sbin

$PATHS When did Apple add /usr/local/bin/ to private/etc/paths?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.