Brew: What does "You may now chown /usr/local back to root:wheel" and what should I do?

Created on 19 Sep 2016  路  15Comments  路  Source: Homebrew/brew

It is shown after I updated Homebrew.

Most helpful comment

Just throwing this here in case somebody else runs into the issue. I ran sudo chown root:wheel #{HOMEBREW_PREFIX} and everything appeared fine. Then ran brew cask list which returned

$ brew cask list
==> Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX
Error: Permission denied - (/usr/local/Homebrew/Caskroom, /usr/local/Caskroom)Most likely, this means you have an outdated version of Homebrew-Cask. Please run:

    brew uninstall --force brew-cask; brew untap phinze/cask; brew untap caskroom/cask; brew update; brew cleanup; brew cask cleanup

If this doesn鈥檛 fix the problem, please report this bug:

    https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:519:in `rename'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:519:in `block in mv'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:508:in `mv'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:8:in `migrate_caskroom_from_repo_to_prefix'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc.rb:52:in `init'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:146:in `process'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/brew-cask.rb:8:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:105:in `<main>'

Needed to run sudo brew cask list due to the new permissions:

$ sudo brew cask list
Password:
==> Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX

And now everything works fine without having to resort to sudo again.

All 15 comments

Well, exactly as said "you may now chown /usr/local back to root:wheel".

Congratulations on a successful migration.

Yes but I don't know how to do that.

sudo chown root:wheel /usr/local

You don't have to do that though, it just doesn't matter anymore.

I did it anyway. Thank you.

I just got the same message. While I do know how to do it, it'd like to know why. Was the owner changed in the migration process? And as it says "may", I assume it's not necessary?

Thanks @zmwangx. Can you provide some more background? Why is that message shown and why is it so ambiguous?

@pbregener Homebrew used to require writing access to /usr/local. Now it no longer writes to /usr/local, only subdirectories of /usr/local.

Was the owner changed in the migration process?

No, but Apple likes seeing /usr/local being owned by root:wheel, and major macOS upgrades do that.

And as it says "may", I assume it's not necessary?

It's not.

Thanks for the quick reply and good and short explanation @zmwangx 馃憤

Would it be accurate to say the user still needs to own some/most/all folders under /usr/local? I'm just curious what the "correct" permission set looks like, if such a perspective even exists.

@kevwil Yep. Those folders are checked for you though (and not reset by Apple on updates).

Just throwing this here in case somebody else runs into the issue. I ran sudo chown root:wheel #{HOMEBREW_PREFIX} and everything appeared fine. Then ran brew cask list which returned

$ brew cask list
==> Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX
Error: Permission denied - (/usr/local/Homebrew/Caskroom, /usr/local/Caskroom)Most likely, this means you have an outdated version of Homebrew-Cask. Please run:

    brew uninstall --force brew-cask; brew untap phinze/cask; brew untap caskroom/cask; brew update; brew cleanup; brew cask cleanup

If this doesn鈥檛 fix the problem, please report this bug:

    https://github.com/caskroom/homebrew-cask#reporting-bugs

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:519:in `rename'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:519:in `block in mv'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1558:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1574:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:1556:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:508:in `mv'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/caskroom.rb:8:in `migrate_caskroom_from_repo_to_prefix'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc.rb:52:in `init'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:146:in `process'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/brew-cask.rb:8:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/brew.rb:23:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:105:in `<main>'

Needed to run sudo brew cask list due to the new permissions:

$ sudo brew cask list
Password:
==> Moving Caskroom from HOMEBREW_REPOSITORY to HOMEBREW_PREFIX

And now everything works fine without having to resort to sudo again.

This was messy and is getting messier. Maybe it would be good if the Homebrew devs published a FAQ: "up to version X we did this because of blah1, but since version Y the recommended practice is Z, because of blah2".

@hmijail We'll consider that in future but not at present.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stejmurphy picture stejmurphy  路  4Comments

javian picture javian  路  4Comments

DomT4 picture DomT4  路  3Comments

fxcoudert picture fxcoudert  路  3Comments

Rotonen picture Rotonen  路  4Comments