Tambourine作業メモ

主にスキル習得のためにやった作業のメモ。他人には基本的に無用のものです。

homebrew がおかしくなった

いつの間にか、/usr/localに書き込めなくなったらしい。まじかよ。

・・・というか、たぶんSieraになったタイミングですよね。brew doctorしてみる。()内の訳は私が適当に訳したもの。

> brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
(もし、ISSUEを上げるならメンテナーのデバッグの助けになるから、
このwarningをメモってね。Homebrewを動かすのに必要なものが全部快調なら、
何も気にせずに無視して良いから)

Warning: /usr/local is not writable.
(/usr/localに書き込めないよ)

You should change the ownership and permissions of /usr/local
back to your user account.
  sudo chown -R $(whoami) /usr/local
(/usr/localの所有者とパーミをあなた自身に変えるべき)

Warning: /usr/local is not writable.
Even if this directory was writable when you installed Homebrew, other
software may change permissions on this directory. For example, upgrading
to OS X El Capitan has been known to do this. Some versions of the
"InstantOn" component of Airfoil or running Cocktail cleanup/optimizations
are known to do this as well.
(このディレクトリがHomebrewのインストール時点では書き込み可能だったとしても、
誰か他のソフトが変えちゃうことはあるから。
例えば、El Capitanにアップグレードしたらそうなるみたいよ。
Airfoilの「InstantOn」コンポーネントでもそういうことをするバージョンはあるし、
Cocktailでcleanupやoptimizationしてもなっちゃうんだってさ)

You should change the ownership and permissions of /usr/local back to
your user account.
  sudo chown -R $(whoami) /usr/local

Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.
Please create pull-requests instead of filing issues.
(OS X 10.12を使用中。これは、まだプレリリースだからサポートしてないよ。
ビルドを失敗しちゃったかなんかで止まっちゃった。
ISSUEを作る前に、プルリクを作るんだ!)

Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install pcre2
(インストールされてるformulaで依存が壊れてるのがあるよ)

Run `brew missing` for more details.

Warning: Your Homebrew is outdated.
You haven't updated for at least 24 hours. This is a long time in brewland!
To update Homebrew, run `brew update`.
(Homebrewが古すぎるよ!。もう24時間もアップデートしてないじゃん。
brewlandじゃ24時間は「昔々」だよ!)

散々な言われっぷりです。

ともかく、言われたとおりに/usr/localの所有者を変える。

bash-3.2$ ls -ltr /usr
total 0
drwxr-xr-x     3 root  wheel    102  8 30 11:10 adic
drwxr-xr-x     4 root  wheel    136  9 14 09:51 standalone
drwxr-xr-x    46 root  wheel   1564  9 23 02:40 share
drwxr-xr-x   245 root  wheel   8330 10 30 03:00 sbin
drwxr-xr-x   275 root  wheel   9350 10 30 03:00 lib
drwxr-xr-x   199 root  wheel   6766 11 11 15:41 libexec
drwxr-xr-x  1058 root  wheel  35972 11 11 15:41 bin
drwxr-xr-x    21 root  wheel    714 11 13 16:33 local
bash-3.2$ echo $(whoami)
tambara
bash-3.2$ sudo chown -R $(whoami) /usr/local
Password:
bash-3.2$ ls -ltr /usr
total 0
drwxr-xr-x     3 root     wheel    102  8 30 11:10 adic
drwxr-xr-x     4 root     wheel    136  9 14 09:51 standalone
drwxr-xr-x    46 root     wheel   1564  9 23 02:40 share
drwxr-xr-x   245 root     wheel   8330 10 30 03:00 sbin
drwxr-xr-x   275 root     wheel   9350 10 30 03:00 lib
drwxr-xr-x   199 root     wheel   6766 11 11 15:41 libexec
drwxr-xr-x  1058 root     wheel  35972 11 11 15:41 bin
drwxr-xr-x    21 tambara  wheel    714 11 13 16:33 local
bash-3.2$ 

これで、brew updateしてみる

bash-3.2$ brew update
Updated Homebrew from 7c7e2d0 to 62e0ecd.
Updated 1 tap (homebrew/core).
==> New Formulae
amqp-cpp                                 mikutter
(中略)
==> Migrating HOMEBREW_REPOSITORY (please wait)...
==> Migrated HOMEBREW_REPOSITORY to /usr/local/Homebrew!
Homebrew no longer needs to have ownership of /usr/local. If you wish you can
return /usr/local to its default ownership with:
  sudo chown root:wheel /usr/local

え、そうなの?でも別に戻す動機もないのでそのままにしておく。もう一度、brew doctorする。

bash-3.2$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your Xcode (8.0) is outdated.
Please update to Xcode 8.1 (or delete it).
Xcode can be updated from the App Store.


Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
  brew install pcre2

Run `brew missing` for more details.

これは後でやっとこう。