mac 执行brew update 总报错 Error: Could not link: /usr/local/etc/bash_completion.d/brew

错误:

localhost:src shaozeming$ ./configure

Updating Homebrew...

==> Auto-updated Homebrew!

Updated 1 tap (homebrew/cask).

No changes to formulae.

Error: Could not link:

/usr/local/share/doc/homebrew

Please delete these paths and run `brew update`.

Warning: coreutils 8.30 is already installed and up-to-date

To reinstall 8.30, run `brew reinstall coreutils`

解决方法:

sudo rm -rf /usr/local/etc/bash_completion.d/brew
sudo rm -rf /usr/local/share/zsh/site-functions/_brew
sudo rm -rf /usr/local/share/man/man1/brew.1
sudo rm -rf /usr/local/share/doc/homebrew
brew update