Help us understand the problem. What is going on with this article?

Homebrewのアップデート時に出た5つのWarningと解決方法

More than 1 year has passed since last update.

久しぶりにbrew updateをかけようとしたらエラーが出てアップデートできなかったので、brew doctorで出たWarningと解決手順をメモ。

環境

MacBook Pro (Retina, 13-inch、Early 2015)
OS X El Capitan バージョン10.11.6(15G1004)
XQuartz 2.7.8
Xcode Version 8.0 (8A218a)

5つのWarningが出たよ

brew doctorを叩いて出たWarningは以下の5つ。

Warning: Your XQuartz (2.7.8) is outdated
Please install XQuartz 2.7.9:
  https://xquartz.macosforge.org

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:
    mono

Warning: You have Xcode 8 installed without the CLT;
this causes certain builds to fail on OS X El Capitan (10.11).
Please install the CLT via:
  sudo xcode-select --install

Warning: Broken symlinks were found. Remove them with `brew prune`:
    /usr/local/share/man/man8/prlexec.8

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
    openssl

順番に解消していく。

解決方法

1.XQuartzのアップデート

Warning: Your XQuartz (2.7.8) is outdated
Please install XQuartz 2.7.9:
https://xquartz.macosforge.org

XQuartzが古い。公式サイトから最新版をインストールする。

2.monoのシンボリックリンクを貼り直す

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:
    mono

monoのシンボリックリンクが切れてる。
brew link monoでシンボリックリンクを貼る。

Error: Could not symlink bin/al
Target /usr/local/bin/al
already exists. You may want to remove it:
  rm '/usr/local/bin/al'

こんなErrorが出たらoverwriteオプションつけて強制的に上書きする。
$ brew link --overwrite mono

3.CLTのアップデート

Warning: You have Xcode 8 installed without the CLT;
this causes certain builds to fail on OS X El Capitan (10.11).
Please install the CLT via:
  sudo xcode-select --install

XcodeのCLT(Command Line Tools)が古いのでアップデートする。

4.デッドシンボリックリンクを削除

Warning: Broken symlinks were found. Remove them with `brew prune`:
    /usr/local/share/man/man8/prlexec.8

これは単純に書かれてるコマンド叩いたら権限がないとのエラーが出た。

$ brew prune /usr/local/share/man/man8/prlexec.8
Error: Permission denied - /usr/local/share/man/man8/prlexec.8

親フォルダの所有者を実行ユーザーにして権限を付与。
$ sudo chown -R unsoluble_sugar /usr/local/share/man/man8
再度brew pruneを叩いて解決。

$ brew prune /usr/local/share/man/man8/prlexec.8
Pruned 1 symbolic links and 5 directories from /usr/local

5.opensslのシンボリックリンクを貼り直す

Warning: Some keg-only formula are linked into the Cellar.
Linking a keg-only formula, such as gettext, into the cellar with
`brew link <formula>` will cause other formulae to detect them during
the `./configure` step. This may cause problems when compiling those
other formulae.

Binaries provided by keg-only formulae may override system binaries
with other strange results.

You may wish to `brew unlink` these brews:
    openssl

opensslのシンボリックリンクを削除。
$ brew unlink openssl
貼り直す。
$ brew install openssl
これだけ。

Homebrewをアップデート

brew doctorで問題が解消されていることを確認。

$ brew doctor
Your system is ready to brew.

brew updateでHomebrewをアップデート。

$ brew update
Updated 1 tap (homebrew/core).
==> Updated Formulae
ace                            gnome-builder                  gucharmap
clutter-gtk                    gnome-icon-theme               mongodb
evince                         gsettings-desktop-schemas      neofetch
gedit                          gtk+3                          nmap
git-archive-all                gtkmm3

おしまい。

unsoluble_sugar
フルオタクエンジニア
https://unsolublesugar.com
techhunterorg
Always absorb new technology
https://techhunter.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした