こへいの日記

大したことは書けません

EI Capitanに変えたらbrew updateでError

この症状の人が多いし、まとめてる人も多いので自分も備忘録程度にまとめる。

 

brew update

 入れたてほやほやのEI Capitan上で、このコマンドを打ったら

Error: The /usr/local directory 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.

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

 と出てきた。

 

OMG

醸造手順書がupdateされないのは悲しい.

 

恐らく/usr/local以下の権限がadminじゃない臭い

ので、とりあえずusr/local/の状態を見てみた。

 

ls -ldで見てみると

drwxr-xr-x+ 46 kohei  staff  1564  2 15 00:55 .

先頭から

d : ファイルタイプ

rwxr-xr-x+ : アクセス権

46 : ハードリンクの数

kohei : 所有者名

staff : グループ名

1565 : サイズ

2 15 00:55 : タイムスタンプ

. : ファイル名

 

staffになってて書き込みができないっぽい?

ので、

sudo chown -R $(whoami):admin /usr/local

してからls -ld で確認してみると

drwxr-xr-x  20 kohei  admin  680  2 18 18:31 /usr/local/

変わったことを確認した後、

brew update出来るようになった。

 

うれしいんやざ