I've followed the instructions of the both the accepted answer to this question as well as the other suggestions, How do I install GCC via Homebrew?. But all I get is the following message when I run the brew install gcc command:

Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. Error: Failure while executing: /usr/bin/otool -L /usr/bin/install_name_tool

And if I try to run the brew install gcc command with sudo:

Error: Cowardly refusing to `sudo brew install` You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk.

Why is this happening and what can I do to get around it? And yes, I've got the latest version of xcode.

  • What exact commands did you run 0- the first error says you don't have admin rights - is that correct?
    – mmmmmm
    Oct 6, 2015 at 18:56
  • See my updated op. I should have admin rights, I've never had any problems installing stuff using brew before.
    – bork
    Oct 6, 2015 at 19:03
  • Have you installed Xcode or its command line tools and accepted their license
    – mmmmmm
    Oct 6, 2015 at 19:14

1 Answer 1


brew doesn't need root permission. Do you have Xcode installed? If you do have you opened it up and agreed to the license?

  • yes (as I wrote in my op), but I had no idea I had to open up the application and agree to the terms. Pretty stupid imho, but thanks! It's now working.
    – bork
    Oct 6, 2015 at 19:32

You must log in to answer this question.

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