Homebrew 1.1.0
brew.sh
brew.sh
The sign of a great project isn't just that it does one thing well, but that it grows with the needs of the users and engages with them to constantly make something better without falling prey to bloat. And by that measure, Homebrew gets a gold star.
But I'm not sure if brew has everything or is updated faster than nvm.
Makes it a lot simpler to do a clean OS install every upgrade, and to make sure all three of my Macs are perfectly in sync!
See my Brewfile in my dotfiles for how I use it to install my stuff: https://github.com/MikeMcQuaid/dotfiles/blob/master/Brewfile
If you want to go a step further there's also Strap which will bootstrap your macOS system with some sensible defaults and install Homebrew, your dotfiles and your Brewfile: https://github.com/mikemcquaid/strap
Finally, if you're interested how I combined these to replace Boxen at GitHub (our macOS system/project bootstrap tool using Puppet) read this: http://mikemcquaid.com/2016/06/15/replacing-boxen/
I've been looking like this for quite a while. I'm still looking through it all, but I don't suppose you have a solution for setting System Preferences, particularly Trackpad settings and remapping the Caps Lock key to Ctrl?
Thanks Homebrew maintainers, you make macOS rock even more!
I understand that running a program that runs third-party scripts under sudo is a security nightmare, but there has to be a better solution than globally chowning /usr/local.
[UPDATE] Apparently, this is no longer the case. Good to know!
[UPDATE2] Alas, the problem seems to not have been fully addressed. You still need to chown /usr/local/bin :-(
As of 1.0.0: you don't need to do this any more and we don't ask you to.
https://github.com/Homebrew/brew/blob/master/docs/Installati...
Does that seem likely? Usual? What's the ideal solution?
EDIT: I know how to `chown`, I mean more, what can I give back to root, what needs to remain under homebrew's control? Does the new version ship with a tool/command that does this?
We'll tell you what permissions you need to keep/remove. Alternatively, uninstall and reinstall Homebrew and similarly we'll tell you on permissions.
If you're concerned about safety, you could maybe "freeze" your homebrew install by chowning /usr/local back to root in between brew invocations.
Absolutely. That's why the canonical gnu installation separates "make" from "make install". But homebrew could do the same thing (and maybe it does now -- I need to go back and revisit this because apparently this issue has been resolved.)
I was pleasantly surprised that, despite Homebrew taking so much of the OSX package management mind-share these days, MacPorts still has an active and vibrant community going strong. I was also pleasantly surprised by just how well Pkgsrc works on OSX, despite its origins on NetBSD. In fact, Pkgsrc works so well that I've switched to using it on Slackware as my primary package manager for anything not in the base system, preferring it to SlackBuilds.org and sbotools (though I still use sbotools whenever Pkgsrc doesn't have a package I want — which sometimes leads to duplicate dependencies in different paths... still haven't figured out how to avoid that yet...).
I've tried homebrew also, but it just feels more like a hack put together. Maybe version 1.1.0 is better, but I'm still going to stick with MacPorts.
Each to it's own, but I wish MacPorts would get more coverage in the news and in the OS X development world.
[1] https://gist.github.com/jaymcgavren/bb85914950578edabad190c3...
Why is this a really bad idea for a personal machine? The only problems I can think of are some subdirectories that are conventionally given some other user ownership to make running a related server under a specific user, and the problem of putting potentially arbitrary probably unreviewed executables in a system-wide path. But the former problem is one you wrestle with anyway if /usr/local is owned by root. And the latter problem... you're going to have some path where you're putting all this stuff, and it's either going to be a personally owned or system owned path. The system-owned choice means giving your package manager sudo and having to run things with sudo (which, without attention, means giving the executables system-wide access). What other problems does a personally owned path create? What's the alternative?
It's a security risk. Having user access to /usr/local allows me (or, more to the point, an attacker running as me and not root) to surreptitiously replace system binaries, some of which may be run by other users. Some of those other users may have access to parts of the system that I don't have. Some of those other users may even be running as root.
> What's the alternative?
/usr/local/homebrew/bin. Or even better /opt/homebrew/bin. Or even better, a path that is set in an environment variable.
Also you can actually install it wherever you like, this is just the default/recommended location:
https://github.com/Homebrew/brew/blob/master/docs/Installati...
Because, if they had picked their own directory and not a standard one like /usr/local/bin, then they would only be putting the homebrew installed binaries at risk. It would be better for defense in depth if they had not. As it is, all of their users are incentivized to unnecessarily give up a little security in favor of convenience. It's precisely that mindset that's one of the "enemies." (The other "enemy" is security without concern for convenience. We know from practice that's just as broken.)
You are going to have both in your $PATH in order to run the binaries, so if an attacker can write to either bad stuff could happen.
Normally, you'd need root privileges to write to /usr/local/bin. Since it's a very popular location for installing 3rd party tools, homebrew is effectively incentivizing users to have more writable executables than otherwise.
Homebrew also aids security by making it easier for devs to keep executables updated. They also deserve credit for making something useful. I use homebrew as well. However, I still really wish they would've made a different decision about /usr/local/bin.
But you're right: to really fix this problem requires that homebrew change its installation process entirely.
Install software as root, eg by invoking sudo.
The "don't compile as root" argument is correct, that too is a bad idea. But that's exactly why traditional "./configure; make; sudo make install" instructions separate the initial build (using the default make target) from a the install target.
It's why binary packages for basically every platform are built using a controlled, non root-user environment, but installed using root-equivalent permissions.
I did a fresh install of macOS with Sierra and decided to use Nix instead of Homebrew this time around. So far I've only started reading through the docs and only have a few things installed; git, vim, tmux. What are your thoughts about using it as a Homebrew alternative?
I've been using Homebrew for years and have been a huge fan so far. I often look at formulas when trying to build things from scratch on Linux.
Besides that, it's great. The about page sums its features up nicely: http://nixos.org/nix/about.html
For example?
Also the HN link in my previous comment has some good discussion of it, just scroll down past the initial Docker comparison thread.
For me the main benefit of it is that I trust it. It doesn't take over system directories like Homebrew, which bugs me even though I'm on a single-user system where that should be ok. Both installs and uninstalls are deterministic, complete, and don't screw anything else up in the system. You can install different versions of the same package side-by-side, which the Debian and Red Hat Alternatives systems also enable, but Nix is more sophisticated about it tagging everything with a cryptographic hash of its build tree. MacPorts and pkgsrc may also provide some of this, but Nix feels more like the git of package managers than anything else I've used, eg the one that finally gets packaging right.
- Disable SHA-1 checksum support in formulae
- Disable running Homebrew as the root user (e.g. sudo brew)
- Bottles with _or_later tags no longer use _or_later in their filenames so the existing bottle can be reusedOnly in the Homebrew backwards-day world is having globally installed software not owned by root "frowned upon".
I'm ambivalent. If I rev 1.0 - 1.1, then I'm going to assume the API won't change, even if I'm using undocumented and warning-spitting methods.
But I shouldn't be doing that, I shouldn't roll in a minor update without at least reading the change log, it's a FOSS project run by a volunteer staff, and brew never swore an oath to follow the laws of versioning as set by semver.org.
If the brew documentation said, "We use semantic versioning," then I'd say the complainants were correct. Otherwise, versions are just versions, and all you can count on is (Major Changes).(Medium Changes).(Minor Changes).(Tiny Changes).(etc.)
edit: Thoughts:
Years and years ago, I spent a lot of time and energy ranting about the fact that Google called GMail "beta software" when it was clearly not feature complete, and beta has a meaning, and we are just destroying a useful system of names for the software testing and release cycle, and…
But in the end, version numbers and development stages are language, and you cannot force your language on others, irregardless of whether or not you'd like to.
And here I disagree, quite strongly. If I'm using "undocumented and warning-spitting methods" then I know what I have done is a hack and those methods could disappear or change at any time and I should proceed at my own peril.
We're in complete agreement, actually. I'm just saying that I generally don't expect things like that to change on a point release, not that it can't, won't, or shouldn't. You're definitely juggling chainsaws if you're in a situation like that.
why? Just curious, because I always use macports with sudo.
So why did you choose to disable running as root altogether rather than dropping privileges when building?
EDIT: The rationale for using /usr/local has been explained in the FAQ: https://github.com/Homebrew/brew/blob/master/docs/FAQ.md#why...
1. /usr/local/bin is already in your PATH
But not /usr/local/sbin, which I had to add anyway. 2. Tons of build scripts break
Not that much anymore, and gems can now be configured much more easily thanks to bundler. It's indeed a chore to tell configure to link against this or that, but most of the time you just build a package anyway (trivial with pacman/abs) for things to be managed. 3. no need to worry about messing up existing tools.
But many third party tools install stuff in /usr/local. Also, SIP prevents any mess from happening to system stuff.Also, regarding sudo:
But do you trust the multi-megabyte Makefile that Homebrew runs?
No I don't, that's why make/make install gets run as a regular user but under fakeroot when packaging with, say, pacman/abs.Running the install phase as root allows the package manager to make things just work, such as installing OpenVPN (which depends on tuntaposx kexts), or install daemons under their own user and have them launched on system boot (not user login) by /Library/LaunchDaemons, or install Python under /Library/Frameworks (which ironically, brew builds as a framework but stores somewhere else).
Again, those are tradeoffs and it's good that a stance is taken either way.
Disclaimer: long-time tentative maintainer of Arch OS X
Perhaps your release of Homebrew is better and safer than you expected? :D
While I share your misgivings about sticking stuff like this at the "system" level, I think they are right to do so in this case, for simplicities sake.
For me these locations are an artifact of multiuser systems days, it's generally more desirable for me to store most stuff in my home directory, such that when I upgrade computers, there's only one thing to copy over.
I mean, I understood you, I'm fairly sure brew is the only Ruby command I run on a regular basis...
The multiuser features are used to provide defense in depth, especially for developer machines.
For me these locations are an artifact of multiuser systems days, it's generally more desirable for me to store most stuff in my home directory, such that when I upgrade computers, there's only one thing to copy over.
Apple's migration tool and cloning have always worked for me.
Annoyingly, the FHS isn't POSIX (nor SUS) and thus not Unix. There's thus no real standardisation on what the filesystem should look like and thus even Guix or Gobolinux can be POSIX candidates.
Even macOS takes advantage of this nonstandardisation by putting stuff in /Applications, /Library and /Users.
The debate about what belongs in /usr, /usr/local, /opt (and hahaha, /opt/local) is mostly subjective opinions about just how local these local things are.
Can't say enough good things about pkgsrc.
First, Macports is often the fastest at updating their ports database after new versions of an upstream are released. Next, I also like that Macports doesn't really rely on anything OS-X specific except for Xcode. So I don't need to worry about crap like whether some Python package will work with Apple's Python distribution, or whether installing a new version of Openssh will break any core Mac OS components.
This is exactly why I use Macports. Everything lives in a parallel universe of /opt. This means the first few packages you install take WAY long as they pull in a ton of dependencies; Homebrew avoids this by relying on stuff already installed by the system. But the up-front cost pays off in the long run (IMO) since you face fewer issues with breakage. OS X can update its userland tools and you generally don't care.
Today, i got into a fight with Homebrew because i wanted to use a second user account on my laptop. I have one primary account, and another i use when doing workshops with clients, so i don't accidentally show them my sekrit files. The only way to get brew to install things without making trouble was to sudo -i to my primary account in a shell.
Don't get me started on "brew install docker" vs "brew cask install docker".
That said, 'sudo port upgrade git' has been failing for me for about a day now, because none of the archives have 2.10.1. I see this sort of thing occasionally, and it's annoying, but not really obstructive.
You are probably using on old version of OS X that does not yet support TLS 1.2. Therefore system's libcurl cannot talk to https://kernel.org anymore, which got very strict recently. As a workaround, you can download the tarball manually with your browser and place it into /opt/local/var/macports/distfiles/git/.
And that's a big problem right there, I don't use xcode and its also a 15GB install!, so a waste to my small 128GB ssd.
Not to mention you will get nagging updates of a huge app you don't use, which takes lots of time to download and install.
Why doesn't macports make their pkg manager work just with the xcode cli tools? and for those pkgs that need xcode, tell the user they need to install xcode first.
I'm a daily linux user, but occasionally some job requires me to use a Mac. Every time I see some OSX tool that starts with the premise of "just go ahead and `sudo chown` a system location and then curl this script into a `sudo bash` pipe" I just think to myself, if they care so little about security to not get the easy stuff right, can I really expect them to nail the hard stuff?
Usually not. I'll have to give Macports a try. As I understand it, it's an implementation/port of the BSD ports system, so I'd expect it to have a more solid foundation.
$ sudo port install texlive +full
Have you tried installing TeX Live with Homebrew? I can't even fathom using a package manager that complains about managing packages 'cause it is too hard. > Error: No available formula with the name "texlive"
> ...
> You can install it with Homebrew-Cask:
> brew cask install mactex
And then `brew cask install mactex` works nicely. $ brew info texlive
Installing TeX from source is weird and gross, requires a lot of patches,
and only builds 32-bit (and thus can't use Homebrew deps on Snow Leopard.)
We recommend using a MacTeX distribution: https://www.tug.org/mactex/This boils down to: Vagrant, Mercurial, Git, GPG Suite, Autotools, tree and wget.
For example, I want to search for a package name before installing. I'm guessing it's just "brew search pkg"... yup. Now what do I do with nix? Google says it's "nix -qa pkg", that totally makes sense, and I just love how I have to memorize some arcane letters.
This is true for virtually every linux package manager I've tried (wtf is apt-cache? I can't remember pacman commands after using it for a year). Seriously, typing anything with a minus sign is slower than typing word, so what's even the point? At this point I won't (choose to) use a package manager that doesn't get this right.
$ brew search x11
x11vnc
Error: GitHub API Error: API rate limit exceeded for 0.0.0.0. (But here's the good n ews: Authenticated requests get a higher rate limit. Check out the documentation for more details.)
Try again in 54 minutes 49 seconds, or create a personal access token:
https://github.com/settings/tokens
and then set it as HOMEBREW_GITHUB_API_TOKEN.Sure the "fix" is simple. But when I'm evaluating something I'm possibly going to make part of my life, I have to ask myself: how many more surprises await me?
Based on my evaluation of the available package managers, my ranking (for macOS) is:
1) MacPorts 2) Pkgsrc 3) Homebrew 4) Nix
Chocolatey is the best that I've found. I have run into issues though, so I can't say it's perfect or even close. It's not bad though.
Also depending on the type of development you do, you may be able to use Bash On Windows and use ubuntu's apt for everything.
When I have to use a Windows machine I basically do everything in a msys2 terminal.
I found the default terminal pretty lacking, but you can now use mintty as the terminal: https://github.com/mintty/wsltty
With this, it's possibly a better Unix experience than macOS. I haven't used it enough to confidently make such a big statement, but it's worked very well so far in my trials.
(I'm sure all three happen, but if I can't find them with close to 200 packages installed, they must be doing something right)
The biggest issue by far are the number of traditional packages that install in /usr/local with root privileges, thereby clobbering homebrew and making "brew doctor" freak out.
That is very much a problem with Homebrew, not those "traditional" packages.
Never with Homebrew. So much <3
Alas that's also the problem. It makes OSX so familiar that this one OSX machine has now crept into my collection of Linux boxes and won't leave (thank you iOS development). I guess if your only complaint is that the software is too good...that's a pretty great thing :)
Sometimes I wonder how valuable Apple thinks Homebrew is for them. Any info on how much they contribute to the project?
Thanks for stepping up.
cd $(brew --repo); git fetch; git reset --hard origin/master; brew update
Homebrew 1.1.0 Homebrew/homebrew-core (git revision 375a8; last commit 2016-11-07)
It did not mention updating to new version in the output of the update command though.
brew upgrade: updates everything.
$ brew update # get latest version of Homebrew
$ brew cleanup # Homebrew housekeeping
$ brew cask cleanup # Cask housekeeping
$ brew --version
#Expected output: Homebrew 1.1.0Once you get your environment set up it's fine, but try updating to the most recent Mac OS version with a ruby environment and you'll find pretty much all your gemsets broken in one way or another (if you have anything that needs native building).
I might just be bitter, though, as I spent most of a day working through this exact situation just last week.
On the other hand it's been pretty darn good for me.