Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't chown /usr/local in High Sierra #3228

Closed
dtamayo opened this issue Sep 27, 2017 · 4 comments
Closed

Can't chown /usr/local in High Sierra #3228

dtamayo opened this issue Sep 27, 2017 · 4 comments

Comments

@dtamayo
Copy link

dtamayo commented Sep 27, 2017

I am running OS X High Sierra and need to change permissions for /usr/local, but it won't let me. I first ran brew update, and after fixing issues, brew doctor just gives:

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run brew link on these:
gdbm
python
libyaml
ruby

brew link ruby gives:

Linking /usr/local/Cellar/ruby/2.4.2...
Error: Could not symlink include/ruby-2.4.0
/usr/local/include is not writable.

sudo chown -R $(whoami) $(brew --prefix) gives
chown: /usr/local: Operation not permitted

ls -lO /usr gives
total 0
drwxr-xr-x 975 root wheel restricted 31200 26 Sep 21:55 bin
drwxr-xr-x 292 root wheel restricted 9344 26 Sep 22:06 lib
drwxr-xr-x 233 root wheel restricted 7456 26 Sep 21:55 libexec
drwxr-xr-x 13 root wheel sunlnk 416 26 Sep 22:05 local
drwxr-xr-x 246 root wheel restricted 7872 26 Sep 21:55 sbin
drwxr-xr-x 46 root wheel restricted 1472 26 Sep 21:55 share
drwxr-xr-x 5 root wheel restricted 160 21 Sep 00:32 standalone

brew config gives

HOMEBREW_VERSION: 1.3.4
ORIGIN: https://github.com/Homebrew/brew
HEAD: ac8b585
Last commit: 2 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 168b65e
Core tap last commit: 2 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_REPOSITORY: /usr/local/Homebrew
HOMEBREW_CELLAR: /usr/local/Cellar
HOMEBREW_BOTTLE_DOMAIN: https://homebrew.bintray.com
CPU: quad-core 64-bit kabylake
Homebrew Ruby: 2.3.3 => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.0 build 900
Git: 2.14.1 => /usr/local/bin/git
Perl: /usr/local/bin/perl => /usr/local/Cellar/perl/5.26.0/bin/perl
Python: /usr/local/opt/python/libexec/bin/python => /usr/local/Cellar/python/2.7.14/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Java: N/A
macOS: 10.13-x86_64
Xcode: 9.0
CLT: N/A
X11: N/A

Any ideas on how to proceed? Thanks!

@ilovezfs
Copy link
Contributor

Correct. /usr/local can no longer be chown'd in High Sierra. Instead use

sudo chown -R $(whoami) $(brew --prefix)/*

@dtamayo
Copy link
Author

dtamayo commented Sep 28, 2017

Amazing, thanks! I first had to mkdir include and Frameworks in /usr/local before running that command, but now everything works.

@dtamayo dtamayo closed this as completed Sep 28, 2017
@MikeMcQuaid
Copy link
Member

From the issue template:

Please note we will close your issue without comment if you delete, do not read or do not fill out the issue checklist below and provide ALL the requested information. If you do not read fill out the issue template repeatedly you will be blocked from every submitting issues to Homebrew again.

@ethicalhack3r
Copy link

FYI I had to create the /usr/local/include directory before running sudo chown -R $(whoami) $(brew --prefix)/* to fix.

Thank you for the help!

machupicchubeta added a commit to machupicchubeta/dotfiles that referenced this issue Oct 4, 2017
As a workaround, execute the command to the subdirectory.

The error message was:
```
chown: changing ownership of '/usr/local': Operation not permitted
```

See also:
- Homebrew/brew#3228
- https://stackoverflow.com/questions/46459152/cant-chown-usr-local-for-homebrew-in-osx-10-13-high-sierra
@Homebrew Homebrew deleted a comment from EugeneDae Oct 11, 2017
@Homebrew Homebrew locked and limited conversation to collaborators Oct 11, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants