4

I'm trying to install unbound using brew command.

Here's output for brew install unbound:

Warning: unbound 1.6.7 is already installed, it's just not linked.
You can use `brew link unbound` to link this version.

As you can see, I was asked to use brew link unbound to link to unbound 1.6.7.

But I failed to link to it because I got the following error:

Linking /usr/local/Cellar/unbound/1.6.7...
Error: Could not symlink sbin/unbound
/usr/local/sbin is not writable.

I've the other stackoverflow here.

And the answer sudo chown -R $(whoami) /usr/local creates the following error:

chown: /usr/local: Operation not permitted

I'm using macOS High Sierra Version 10.13.2.

How can I solve this problem?

Brian
  • 12,145
  • 20
  • 90
  • 153

1 Answers1

8

The following commands solved my problem.

sudo mkdir /usr/local/sbin
sudo chown -R $(whoami) /usr/local
brew link unbound
Brian
  • 12,145
  • 20
  • 90
  • 153
  • 3
    I think you should only run `sudo chown -R $(whoami) /usr/local/sbin`. There can be security concerns if you completely override ownership for the /usr/local folder itself. I myself don't know all the implications for why /usr/local is always owned by root, and I don't want to break that assumption if I don't have to. – Alexander Bird Mar 04 '19 at 21:16
  • @AlexanderBird Nope. Must be some protected system folder: `TimComp:myfolder tim$ sudo chown -R $(whoami) /usr/local/sbin chown: /usr/local/sbin: No such file or directory TimComp:myfolder tim$ brew link --overwrite unbound Linking /usr/local/Cellar/unbound/1.10.0... Error: Could not symlink sbin/unbound /usr/local/sbin is not writable.` – Timothy Swan Apr 19 '20 at 12:08