Hacker News new | ask | show | jobs
by catmistake 2116 days ago
I recommend macports package management system, similar in function to BSD ports collection. Superior to Homebrew, the johnny-come-lately PMS with all the penguinista-style hype that seems to lean towards binary installs, unlike roll your own from all source in macports. Homebrew also does not honor the default privileges of /usr/local, which is an annoying security flaw.
5 comments

You can transparently run homebrew as a dedicated user, prevent it from accessing your home directory, and only give /usr/local permissions to that user.

https://github.com/lunixbochs/meta/tree/master/utils/brew_al...

I have been doing this for years. The only thing it breaks for me is casks that try to install applications, and I don't mind.

Agreed 100%. No idea why homebrew is so dominant while doing the wrong thing by default. Binaries are nice but not worth the trouble Homebrew gives compared to sane, rational MacPorts.
While Homebrew defaults to binary, it can build from source, though it tends to leave behind a bloody mess when it does.

MacPorts has excellent housekeeping, which is controlled through port command arguments. One can choose to leave everything from the entire build, or have everything cleaned up as it builds, or clean it up after the build. Showing and eliminating leaves is also pretty simple.

Uninstalling MacPorts with these 3 commands leaves absolutely nothing behind:

>$ sudo port -dfp uninstall --follow-dependencies installed

>$ sudo port -dfp uninstall all

>$ sudo rm -rf /opt/local /Library/Tcl/macports*

Good luck completely uninstalling Homebrew without having to look everywhere to make sure it is all gone. It requires downloading and trusting the Homebrew uninstall script.

You may wish to follow the official instructions, which will also remove users that MacPorts creates: https://guide.macports.org/chunked/installing.macports.unins...
+1 for Macports vs Homebrew.

When I first got a Mac about 4 years ago moving from Linux, the first thing I did was compare homebrew and macports.

homebrew was such a cluster-fuck in how it screwed around in /usr/local and its requirements for root etc, especially with Apple's move to basically own most of /usr under SPI.

Macports follows the BSD ports model and since Apple is a BSD based unix underneath, it makes sense. I haven't found anything I've needed that hasn't been ported.

It installs by default in /opt, which is where it should. When needed it will create the appropriate startup configurations for services as part of launchd and in the correct locations.

Or Joyent's "pkgsrc" system, which is also mostly ports-like, works on just about every posixy OS these days (including Linux, NetBSD, Cugwin and more).

Capable of installing both source and binaries. Works well in my experience.

(No experience with MacPorts so I can't compare; but coming from Linux/apt I didn't feel much was missing, just a little different)

While it does default to binaries, it accepts a build-from-source option

I haven't been involved with macports recently enough to compare, but one advantage of Homebrew's popularity is the depth of package specifications and how quickly they're updated