0

I have been trying to install Homebrew on my Mac but ran into permission problems since my user is not an administrator.

I followed the suggestions here: https://stackoverflow.com/a/16450503/4909923

su -l admin
sudo chown -R "$USER":admin /usr/local
sudo chown -R $USER:admin /Library/Caches/Homebrew

Now I'm concerned that I have wrongfully changed the ownership of these folders to a specific user. Will it impact my normal user negatively?

changing ownership of /usr/local to a specific user is not a solution. It is a terrible hack and a workaround if you have a single user system. But then you might as well just chown -R / $USER:$USER – fijiaaron Jan 23

If this was a stupid thing to do, how do I restore it to normal?

It should probably look like the image with /lib/ which is another folder in /usr/, with system Read & Write and wheel Read Only.

/usr/local /Library/Caches/Homebrew another folder in /usr/

It should probably look like this (another folder in /usr/):

Community
  • 1
  • 1
P A N
  • 5,642
  • 15
  • 52
  • 103
  • My `/Library/Caches/Homebrew` directory is owned by root, and `/usr/local` is owned by an admin user on my computer. Both have `rwxrwxr-x` permissions. As long as your permissions are set to work with multiple users on your computer you should be fine. Running `brew doctor` should inform you if there are any severe issues. – Aaron Brager Jun 04 '15 at 20:00
  • @AaronBrager Thanks, but if I want to restore it to the way it was (factory settings), do you know how I can do that? – P A N Jun 04 '15 at 20:06
  • AFAIK, the way I have it is factory settings. – Aaron Brager Jun 04 '15 at 20:12
  • @AaronBrager Would you like to show me the terminal commands for setting the folders to your settings? Sorry if I'm asking for too much, but got a bit paranoid that I've messed up the /usr/local folder. – P A N Jun 04 '15 at 20:14
  • I'm not convinced anything is wrong with your current installation. But you can use `chown` exactly as in your above example, with different users if you want to switch the ownership, and `chmod` to change the permissions (which you probably won't need to) – Aaron Brager Jun 04 '15 at 20:17

1 Answers1

1

I think the permissions I mentioned in the comment should be fine, but if you want to be sure everything is set at its default, you can uninstall Homebrew using this script and then reinstall it from scratch.

You can also follow this advice for resetting the permissions.

Community
  • 1
  • 1
Aaron Brager
  • 65,323
  • 19
  • 161
  • 287
  • It seems like sudo chown -R root:wheel /usr/local did the trick, thanks very much! That changes the owners. Then changed permissions with chmod on the Get Info tab in Yosemite. – P A N Jun 04 '15 at 20:40