LoginSignup
17
15

More than 5 years have passed since last update.

brew cask installのPermission deniedを解決する

Posted at

環境

Mac OS Sierra
バージョン 10.12.3

現象

新たなMacにbrew cask installで環境を構築しようとするとPermission deniedになった。

$ brew cask install atom

==> Satisfying dependencies
complete
==> Downloading https://github.com/atom/atom/releases/download/v1.15.0/atom-mac.zip
######################################################################## 100.0%
==> Verifying checksum for Cask atom
Error: Permission denied - /usr/local/Caskroom/atom
Follow the instructions here:
  https://github.com/caskroom/homebrew-cask#reporting-bugs
...

エラーメッセージ
Error: Permission denied - /usr/local/Caskroom/atom

困った時にはbrew cask doctor

$ brew cask doctor

==> Homebrew-Cask Version
Homebrew-Cask 1.1.12
caskroom/homebrew-cask (git revision 5cb3; last commit 2017-04-04)
==> Homebrew-Cask Install Location
<NONE>
==> Homebrew-Cask Staging Location
/usr/local/Caskroom (error: not writable by current user)
...

error: not writable by current user
どうやらcurrent userには書き込み権限が無いようですね

解決方法

Mac OS Sierraでは/usr/localの権限が強化され制限されているようだ。
以下コマンドで制限を回避する。

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

再度、brew cask installを試す

$ brew cask install atom

==> Satisfying dependencies
complete
==> Downloading https://github.com/atom/atom/releases/download/v1.15.0/atom-mac.zip
Already downloaded: /Users/ikemura/Library/Caches/Homebrew/Cask/atom--1.15.0.zip
==> Verifying checksum for Cask atom
==> Moving App 'Atom.app' to '/Users/z1tg6774/Applications/Atom.app'.
==> Linking Binary 'apm' to '/usr/local/bin/apm'.
==> Linking Binary 'atom.sh' to '/usr/local/bin/atom'.
🍺  atom was successfully installed!

cask installが成功し、無事にatomをインストールできました。

17
15
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
17
15