I installed weechat 1.9(an IRC client) with brew a long time ago. Today I was trying to update the program to the latest version with 'brew upgrade weechat'. The whole upgrading process was successful, only with an error at the end that says

Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink share/man/de/man1/weechat-headless.1
/usr/local/share/man/de/man1 is not writable.

I first figured it might be for the reason that the /usr/local/share/man/de/man1 directory was not writable due to the user that homebrew runs as was not given enough access privilege. I then changed the group owner of the directory from 'wheel' to 'admin' which is the owner of most of the directories generated by homebrew. But it didn't work.

I tried to uninstall and reinstall weechat, it's still the same error.

  • The direct effect for this error is that I cannot start weechat from terminal now, obviously because the program is not symlinked. – LightBlue Jun 4 '18 at 16:09
  • Have you searched for other, similar questions & answers? – fsb Jun 4 '18 at 16:17
  • Have you filed a bug report with HomeBrew? – fd0 Jun 4 '18 at 16:35
  • Yes, I did the search before posting, but didn't find the answer you gave. The other answers I found didn't solve the problem. Your answer helped me. Now I manually symlinked the weechat executable to /usr/local/bin and it worked. Thanks.@fsb – LightBlue Jun 5 '18 at 13:13
  • Now I haven't. @fd0 – LightBlue Jun 5 '18 at 13:13

Just fixed this same issue on my system!

From this related thread about a similar brew link issue with nmap:

I'd wiped /usr/local/ before installing brew, so was unsure about this. Realised that MacTeX installs its stuff in there too by default, causing this issue.

Apparently some software will write to that folder using root privileges on install so there is an ownership issue here.

To fix:

  1. ls -la /usr/local/share/man/
  2. Identify which directories require ownership permission changes
    • Using /usr/local/share/man/de/ as an example, it was owned by user "root" in group "wheel" prior to the fix, whereas we want it to be owned by your user (output of whoami) in group "admin"
  3. Recursively change ownership of the directory and all sub-directories thereof: sudo chown -R $(whoami):admin /usr/local/share/man/de/
  4. Attempt linking again: brew link weechat

The above steps fixed the issue for me!

You must log in to answer this question.

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