6 ms·
I can't think of anything more standard than /usr/local/.
by emanuelev 11y ago
I can't think of anything more standard than /usr/local/.
- deong 11y agoMaking/assuming /usr/local is 0777 is definitely not though.
- baldfat 11y ago/usr should be Read Only http://www.pathname.com/fhs/pub/fhs-2.3.html#THEUSRHIERARCHY http://www.pathname.com/fhs/pub/fhs-2.3.html#THEUSRHIERARCHY
- emocakes 11y ago/opt/local is more correct
- alayne 11y agoiuguy is not talking about use of /usr/local, but rather the fact that homebrew makes it owned by the user who installed homebrew with permissions so that the user can maintain homebrew packages without sudo. Usually /usr/local is owned by root.
- sigsergv 11y agoUnfortunately, /usr/local is a total mess now. There is no internal package management in os x so applications could (and do) overwrite files in /usr/local. These conflicts are very annoying sometimes.
- twic 11y ago/opt? MacPorts uses /opt/local.
- quesera 11y agoBSD and Linux use /usr/local, it's not universal. But /usr/local has never been writable by non-privileged users. Homebrew depends on that nonstandard and undesireable permissions model. Apple doesn't bend to accommodate an inappropriate use. Hombrew doesn't want to use a location that is outside the default PATH, and they don't want to install with proper permissions, so they purposefully misinterpret the "standard". Hijinks ensue, and people blame Apple, which is silly.
- DannyBee 11y agoA. There is no real standard here B. Apple doesn't bend, period. They don't actually care whether the use is appropriate or inappropriate. C. Blaming this on homebrew is hilarious Remind me again why i should need to reboot into recovery mode to create a directory?
- quesera 11y agoA. /usr/local has never ever been writable by a nonprivileged user. Every standard that exists, including the principle of least surprise, is emphatic on that point. The security implications of "any other way" are massive. B. If Linus or the FHS changed their ways in this, there would be outrage. It's inappropriate and just plain dumb. [edit: I shouldn't have said "dumb", please replace with "in violation of all guarantees of system integrity".] C. See above. You apparently have issues with SIP. That's a separate issue from the current thread, but OK. You should reboot to securely change nvram settings that will allow you to manipulate the protected zone of the file system (including /usr) because this concession to inconvenience saves you from privilege escalation attacks. The real question is why you deleted /usr/local in the first place. It's standard OSX, and always has been. If you deleted it before SIP, but object to its absence now that SIP applies to the directory where it lives...I'm not sure how to help.
- alextgordon 11y agoWhere in FHS does it specify that system and user files should be put in /Applications /Library /Network /System /User Information /Users /Volumes ?
- Steuard 11y agoIt's been a while since I looked into it, but I opted to stick with MacPorts rather than Homebrew in large part because I got the impression that Homebrew wanted to own /usr/local rather than sharing it with other software. (Maybe that's inaccurate?) I still occasionally compile software by hand rather than through a package manager, and /usr/local has been the default target for a system-wide install on every Unix-style system that I've used in the past 20-ish years. (Also, my wife and I both have active accounts on my machine, which makes me uneasy having files in a systemwide directory like /usr/local owned by one specific user. That also feels distinctly non-standard to me.)
- omribahumi 11y agoIt is possible to switch /usr/local according to [1], they state it's not recommended though. [1] https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Installation.md#alternative-installs https://github.com/Homebrew/homebrew/blob/master/share/doc/h...
- halostatue 11y agoI have used ~/.brew for years—it means that I have to do a slightly custom install every time I move to a new machine—but have never had a problem with it.
- mjs 11y ago> I got the impression that Homebrew wanted to own /usr/local rather than sharing it with other software This is still accurate. Homebrew creates/manages /usr/local/.git. /usr/local/.gitignore starts with /* which is … not conventional.
- iuguy 11y agoAs others have mentioned, /usr/local may be a fairly standard place to put stuff, but homebrew's permissions model changes the way /usr/local works. Additionally, /usr/local is used by other applications, and there's no way to ensure that it isn't written over by them or by homebrew when installing or upgrading software. Putting homebrew in /opt/homebrew means that you can have a systemwide directory that is self-contained, can have a working unix hierarchy underneath and should work. Putting homebrew in ~/.homebrew/ lets you have a user-specific directory that is self-contained with a hierarchy underneath. In an ideal world, homebrew would use something like /opt/* for systemwide hierarchy and ~/.homebrew for user-specific hierarchy. We don't live in an ideal world, so we just have to make do with fudges to /usr/local permissions for now.
- tptacek 11y agoIt is not standard for /usr/local to be writeable by users.
- specialist 11y agoWhere am I supposed to put stuff like my shell scripts? I'm now using /usr/local/bin. I looked for a guide, no joy. The more opinionated, the better, because I just want to follow the norm.