Macports, meanwhile, continues to work quite well because it 1. places packages in /opt and 2. has always installed via sudo.<p>Macports just has a much more robust philosophy of building its own universe largely separate from OS X, and only rarely impacted by system updates. The downside is that it takes forever to install the first few packages. Homebrew offers a much faster initial install because it leans on OS X libraries for various things. But then it is much more fragile when your system updates. Macports really only depends on a slice of Xcode; from time to time updates will fail to install until you open Xcode and accept whatever new license Apple has bundled with it. But you don't get key components changing out from underneath your packages due to an Apple System Update.<p>My bias here is that I'm a longtime happy Macports user who has tried to use homebrew repeatedly, encountered lots of failed recipes, and gone back to Macports, shaking my head at all the hype around homebrew and the fact that is has somehow become a defacto developer default despite some really sloppy, poorly thought through practices. (And I know that's harsh but for a long time they trashed Macports right in their tagline — "Is MacPorts driving you to drink?" — which just seemed gratuitous.)
I'm curious to know if there's a reason everyone installs Homebrew in /usr/local (other than it being the default installation path). I've always chosen to install it in ~/.homebrew and haven't had any problems. Everything I install with Homebrew seems to handle an alternative prefix without issue.
To be fair, homebrew shouldn't need to change perms, it should follow common unix standards or at least fit in with OSX rather than require a hack. For years I've felt homebrew should really use either /opt/ or ~/.homebrew/ by default.
Installed El Capitan yesterday. Process took almost half an hour.
Afterwards, brew just gave me a warning to do "chown" to my usr/local. That's it. Everything works fine.
This is one of the reasons I love HN: a grapevine of important things to help developers fix their dev environments, security things we need to be aware of for our servers, new APIs to take advantage of, and other important stuff.
If you only need a Unix-style package manager for things like coreutils, nodejs, tmux, irssi, vim, etc, pkgsrc runs on OS X and installs to <i>/opt/pkg</i>. There is no Google Chrome, or fonts, etc in it though, so if you enjoy installing those from Homebrew then this is not for you.<p><a href="http://pkgsrc.joyent.com/install-on-osx/" rel="nofollow">http://pkgsrc.joyent.com/install-on-osx/</a>
How to disable SIP altogether:<p><a href="http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-the-ars-technica-review/9/" rel="nofollow">http://arstechnica.com/apple/2015/09/os-x-10-11-el-capitan-t...</a>
Yeah I see Permission denied messages everywhere now.<p><pre><code> $ brew update
error: unable to unlink old '.gitignore' (Permission denied)
error: unable to create file .travis.yml (Permission denied)
error: unable to unlink old '.yardopts' (Permission denied)
error: unable to unlink old 'README.md' (Permission denied)
Error: Failure while executing: git pull --quiet origin refs/heads/master:refs/remotes/origin/master
</code></pre>
Nice. I saw that I can't change also system icons ( like Automator, AppStore, Maps, Notes, etc. ).<p>Quick check on some forums suggest that I should do that in recovery mode. I guess it will be a mess with almost any other app that needs a bit more permissions and needs the raw UNIX filesystem.
Couldn't all this be avoided if Homebrew installed itself in a sub-directory of /usr/local (e.g. /usr/local/homebrew) instead of /usr/local itself?<p>Edit: For the avoidance of any doubt/confusion, this is what a virgin /usr/local/ looks like after Homebrew has been installed:<p><pre><code> $ ls -la /usr/local
total 96
drwxrwxr-x 13 root admin 442 31 Aug 21:52 .
drwxr-xr-x@ 12 root wheel 408 31 Aug 21:52 ..
drwxr-xr-x 14 jgavigan admin 476 31 Aug 21:52 .git
-rw-r--r-- 1 jgavigan admin 448 31 Aug 21:52 .gitignore
-rw-r--r-- 1 jgavigan admin 291 31 Aug 21:52 .yardopts
-rw-r--r-- 1 jgavigan admin 3161 31 Aug 21:52 CODEOFCONDUCT.md
-rw-r--r-- 1 jgavigan admin 1103 31 Aug 21:52 CONTRIBUTING.md
-rw-r--r-- 1 jgavigan admin 1241 31 Aug 21:52 LICENSE.txt
drwxr-xr-x 9 jgavigan admin 306 31 Aug 21:52 Library
-rw-r--r-- 1 jgavigan admin 2319 31 Aug 21:52 README.md
-rw-r--r-- 1 jgavigan admin 23801 31 Aug 21:52 SUPPORTERS.md
drwxr-xr-x 3 jgavigan admin 102 31 Aug 21:52 bin
drwxr-xr-x 4 jgavigan admin 136 31 Aug 21:52 share</code></pre>
I just did this (from [1]):<p><pre><code> sudo chown -R $(whoami):admin /usr/local
</code></pre>
And not `sudo chown $(whoami):admin /usr/local`. Are both really necessary?<p>[1]: <a href="https://news.ycombinator.com/item?id=10307800" rel="nofollow">https://news.ycombinator.com/item?id=10307800</a>
By the way, there's a way to create /usr/local without rebooting four times like suggested in the doc:<p>- Boot into Recovery (hold cmd+R during boot)<p>- Open Disk Utility<p>- Unlock your system drive (assuming it's encrypted) -- I forget where exactly the option was but it's in DU somewhere.<p>- Open Terminal<p>- Go to your system drive now mounted under /Volumes and do what you gotta do.
This didn't work for me. Upon 3rd bullet point 'Reboot back into OS X' my system kept showing me the apple logo, black background and status bar. When the status bar progressed ~30%, information about my system would popup and then stagnate/momentarily freeze. Then the system would go to black saying 'os had a problem, rebooting in a few seconds' then...it would repeat this process again and again, without any input from me.<p>I'm not sure what to do to fix this.
It does kind of make sense to me that user-owned things should <i>kind of</i> live in /Users/username.<p>Unfortunately that pattern in this case would lead to the redundant-seeming /Users/username/usr/local, but at least that's rooted to the user in the event other users don't want a "global" Homebrew install.<p>Also, I believe (even if it kills some ignorant build scripts) that Homebrew lets you reconfigure where this directory lives, anyway.
In case it's helpful, I blogged the steps I had to take to get my environment back up and running:<p><a href="https://ohthehugemanatee.org/blog/2015/10/01/how-i-got-el-capitain-working-with-my-developer-tools/" rel="nofollow">https://ohthehugemanatee.org/blog/2015/10/01/how-i-got-el-ca...</a>
Why does brew need to install everything owned by my user in /usr/local? I would honestly prefer if everything installed by brew was owned by root:wheel and brew would gracefully abort if I forgot to run it with sudo.<p>Is all that current mess just so that I don't need sudo for brew?
Will homebrew switch the default install location out of /usr/local for new installations then? I doubt most developers will want to dive into recovery mode just to install wget.
My MacTex (Latex) installation broke for the same reason. Luckily, all I had to do was set put "/Library/TeX/Root/bin/universal-darwin/" in my $PATH and change the path of "pdtlatex" and "bibtex" to the GUI tools I use. But still, I lost about an hour or so trying to figure out what is happening.
The first thing I did after the upgrade was disabling SIP. Now my system acts exactly the same way before with all the goodies (except rootless) el capitan has to offer.<p>Having root not able to write system stuff is good for people that like to blindly execute shell scripts from the internet but I think apple should add something that makes it easier for developers to disable it.<p>I don't know if there is a new method yet, but before you had to boot into recovery and execute `csrutil disable`. In the early days there was a boot flag you could set but that got removed quickly.
To me, the fact that you are directed to install Homebrew to /usr/local is wrong since there's no guarantee how /usr/local is going to treated by Apple in the future and this is now an example of that. The only directory that Apple, probably, doesn't have control is your home directory.<p>I've been using homebrew for a long time without issues because, in my opinion, I installed it on ~/homebrew. I wonder why is that so difficult for others to use.
Does is still take a few hours to copy over /usr/local during the upgrade like it did during the Yosemite upgrade or has Apple fixed that?<p>I'm glad I read this before moving the /usr/local directory as was previously suggested <a href="https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/" rel="nofollow">https://jimlindley.com/blog/yosemite-upgrade-homebrew-tips/</a>
Should I create this folder or install brew now? I've been thinking about installing it on my macbook and doing some development on it but haven't yet. Last night it told me the OSX update was available. Which order should I do this? Or should I just not put brew in /usr/local ??
It's easy to get Homebrew and Java running smoothly after the El Capitan upgrade.<p>Read this:<p><a href="http://lexsheehan.blogspot.com/2015/10/el-capitan-homebrew-and-java.html" rel="nofollow">http://lexsheehan.blogspot.com/2015/10/el-capitan-homebrew-a...</a>
Is this also related to why you can't rename /usr/local to /usr/local.old? (To do a fresh install of homebrew into /usr/local.)<p><pre><code> $ sudo mv local local.old
mv: rename local to local.old: Operation not permitted</code></pre>
Using a $150 Chromebook from Walmart with the built-in ssh and my VPSs or xfce via crouton when I feel like it. Works great for web development. No UNIX/linux compatibility problems since it is actually Linux.
I installed El Capitan this morning and was expecting to have to do this - I did not. chown stayed owned to me properly, brew functioned as it was before... everything fine.
When I first read this I was a little pissed at Apple, but what if brew were to install everything to /brew? It doesn't need to install into /usr/local.
Before Apple there was companies' IT's Puppet mangaging away /usr/local from usefulness. Main reason I only use Macports which has never failed me.
Just make sure that if there are any launch daemons plist files, those should be root:wheel. Otherwise "launchctl" won't load those daemons.
The sad part is that /usr was supposed to be the original Unix user home directories.<p>/bin was where you kept your binaries, and /lib for your libraries.
I update 6 hours ago and tweeted about it<p>brew doctor
brew prune
sudo chown -R `whoami` /usr/local
brew missing<p><a href="https://twitter.com/senthilnayagam/status/649400417323880448" rel="nofollow">https://twitter.com/senthilnayagam/status/649400417323880448</a>
Users should have full control over their own machines. System Integrity Protection is obnoxious paternalism at best, and at worst, it's just another step toward iOS-ification. If Apple keeps this up, I expect a revival of Linux desktop distributions.