Script requires admin privs, but I am an admin

(Chris Anselmo) #1

Something very strange is going on. I installed homebrew on my mac when I first set it up a few years ago, and suddenly I dont have it anymore. I found out that I didn’t have it anymore, because I suddenly didn’t have wine anymore, which I installed through homebrew. It turns out that homebrew and everything I installed through homebrew is gone, for seemingly no reason.

Anyway, I decided to just deal with it and reinstall homebrew. Well, when I try to do that, I get the “This script requires the user to be an Administrator.” error. I am an admin, however so I’m not really sure what to do. I have a feeling this isn’t an error with homebrew and something screwy with my mac, but I honestly don’t know where else to ask… If anyone knows anything about this I could really use some help.

I have confirmed that I am an admin by doing dsmemberutil checkmembership -U chrisanselmo -G admin (my username is chrisanselmo) and it indeed replies with user is a member of the group.

(Sean Molenaar) #2

What’s going wrong with the script that makes you think you aren’t an admin though?

(Chris Anselmo) #3

Well the error I’m getting is “This script requires the user to be an Administrator” which makes me think the script doesn’t think I’m an admin or I somehow don’t have proper permissions

(Sean Molenaar) #4

Does it fail with that message? Or does it just inform you that you need to be an admin?

(Chris Anselmo) #5

Here is exactly what happens. It’s the only message that appears.

(Sean Molenaar) #6

You seem to be using a non-standard shell. Can you try running this in the default bash shell?

(Chris Anselmo) #7


Yeah, I’m using zsh. I tried running it after switching to bash, still no dice…

(Sean Molenaar) #8

there should be the $USER variable from your environment there. Can you echo that one for yourself?

(Chris Anselmo) #9


Seems empty…?

(Sean Molenaar) #10

Then that’s an issue in your setup, maybe google can help you figure out how that happened? (I can also help you guess but I don’t think it’d be nearly as fast or accurate.)

(Chris Anselmo) #11

$USER being empty was the issue! Just added it manually to my .zshrc with my username and brew installed fine. Don’t know how it got messed up in the first place, but shrug. Thanks man.

(Sean Molenaar) #12

It usually gets filled on login. Maybe it wasn’t a login shell or something? But nice to hear it works now.