I had admin account before and I deleted the admin and made the user as admin because it was bit of pain in neck. This is now the admin user called zuhairhallak. Before, installing Homebrew, it was just user without any privileges. I want to fix that. I tried to remove Homebrew but it did not let me.

zuhairs-mbp:~ zuhairhallak$ sudo chown -R $zuhairhallak /usr/local/share/aclocal /usr/local/share/doc /usr/local/share/info /usr/local/share/locale /usr/local/share/man /usr/local/share/man/man1 /usr/local/share/man/man3 /usr/local/share/man/man5 /usr/local/share/man/man7 /usr/local/share/man/man8 /usr/local/share/zsh /usr/local/share/zsh/site-functions
chown: /usr/local/share/aclocal: illegal user name
  • Welcome to Ask Different :) As stated, your query is not clear. Kindly consider editing your post and clearly specify the problem that you are facing and any salvage actions that you have attempted. It generally helps to mention the make and model of your hardware along with the version of operating system software (iOS/macOS) running on your device. – Nimesh Neema Mar 20 at 22:10
  • I suspect this has nothing to do with unwritable, and I doubt your user name contains $ - is that your actual question? The brew doctor command will give you the syntax to fix things, too but perhaps you want to learn why yours causes an error. – bmike Mar 20 at 22:12

I would start with a simpler command.

sudo chown -R 501 /usr/local/share/aclocal

Use a user number instead of name to see if that’s he error. Also, do one directory first to be sure where the error arises. You could even skip the -R if the above command fails to further reduce the variables in play.

  • zuhairs-mbp:etc zuhairhallak$ sudo chown -R 501 /usr/local/share/aclocal sudo: /etc/sudoers is owned by uid 501, should be 0 sudo: no valid sudoers sources found, quitting sudo: unable to initialize policy plugin – Tahan Mar 20 at 23:00
  • @Tahan See apple.stackexchange.com/questions/157772/… for how to fix this. – nohillside May 2 at 7:38

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .