環境
- macOS big sur
- Homebrew 2.7.5
症状
brew doctor を実行すると、3つの警告が出た;
Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: rtmpdump Warning: Xcode alone is not sufficient on Big Sur. Install the Command Line Tools: xcode-select --install Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting the PATH for example like so: echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
作業
この3つの警告をひとつずつ消していく。
1st
Warning: You have unlinked kegs in your Cellar. Leaving kegs unlinked can lead to build-trouble and cause brews that depend on those kegs to fail to run properly once built. Run `brew link` on these: rtmpdump
rtmpdump のシンボリックリンクが切れてるらしい。
brew link rtmpdump を実行。エラーが出た;
Linking /usr/local/Cellar/rtmpdump/2.4+20151223_1... Error: Could not symlink lib/librtmp.dylib Target /usr/local/lib/librtmp.dylib already exists. You may want to remove it: rm '/usr/local/lib/librtmp.dylib' To force the link and overwrite all conflicting files: brew link --overwrite rtmpdump To list all files that would be deleted: brew link --overwrite --dry-run rtmpdump
/usr/local/lib/librtmp.dylib が既に存在するらしい。
わかんないけど、消しちゃう;
rm '/usr/local/lib/librtmp.dylib'
再び brew link rtmpdump を実行したらエラーは出ずに終了した。
再び brew doctor をすれば、該当の警告は消えていた。
2nd
Warning: Xcode alone is not sufficient on Big Sur. Install the Command Line Tools: xcode-select --install
xcode-select --install を実行。
するとウィンドウが出てきたので、ボタンを押してインストール。

暫し待つ。結構重い。
インストールが完了してから brew doctor を実行すると、該当の警告は消えていた。
3rd
Warning: Homebrew's sbin was not found in your PATH but you have installed formulae that put executables in /usr/local/sbin. Consider setting the PATH for example like so: echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
/usr/local/sbin にパスを通したいらしいので、通してあげる;
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.zshrc
rcファイルを再読み込み;
source ~/.zshrc
以上の操作で、brew doctor はもう警告を吐かなくなった。