homebrew-cask: Error: Permission denied when try to install a cask
I am trying to create a cask for VirtualBox, but when I run brew cask install virtualbox, it downloads, and when it tries to verify the checksum, I get a permission denied error. Is this because I am not a sudo user? The same thing happened when I tried to install iTerm2.
OS X El Capitan 10.11.3 ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin14]
Here is my output of brew cask install iterm2 --verbose:
==> Downloading https://iterm2.com/downloads/stable/iTerm2-2_1_4.zip
/usr/bin/curl -fLA Homebrew-cask v0.51+ (Ruby 2.0.0-645) https://iterm2.com/downloads/stable/iTerm2-2_1_4.zip -C 0 -o /Library/Caches/Homebrew/iterm2-2.1.4.zip.incomplete
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 3114k 100 3114k 0 0 222k 0 0:00:13 0:00:13 --:--:-- 216k
==> Verifying checksum for Cask iterm2
Error: Permission denied - /opt/homebrew-cask/Caskroom/iterm2
Most likely, this means you have an outdated version of homebrew-cask. Please run:
brew uninstall --force brew-cask; brew untap phinze/cask; brew update; brew cleanup; brew cask cleanup
If this doesn’t fix the problem, please report this bug:
https://github.com/caskroom/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/installer.rb:105:in `extract_primary_container'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/installer.rb:70:in `install'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/install.rb:20:in `block in install_casks'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/install.rb:17:in `each'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/install.rb:17:in `install_casks'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli/install.rb:6:in `run'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:83:in `run_command'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib/hbc/cli.rb:121:in `process'
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/cmd/brew-cask.rb:26:in `<top (required)>'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Site/2.0.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Users/CalebKleveter/usr/local/Library/brew.rb:21:in `require?'
/Users/CalebKleveter/usr/local/Library/brew.rb:89:in `<main>'
Error: Kernel.exit
Here is the output from 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: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
Having additional scripts in your path can confuse software installed via
Homebrew if the config script overrides a system or Homebrew provided
script of the same name. We found the following "config" scripts:
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4-config
/Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4m-config
/usr/local/bin/powerline-config
/usr/local/bin/python3-config
/usr/local/bin/python3.4-config
/usr/local/bin/python3.4m-config
/opt/sm/pkg/active/bin/curl-config
/opt/sm/pkg/active/bin/ncurses5-config
/opt/sm/pkg/active/bin/ncursesw5-config
/opt/sm/pkg/active/bin/pkg-config
/opt/sm/pkg/active/bin/xml2-config
/opt/sm/pkg/active/bin/xslt-config
Warning: Python is installed at /Library/Frameworks/Python.framework
Homebrew only supports building against the System-provided Python or a
brewed Python. In particular, Pythons installed to /Library can interfere
with other software installs.
Warning: You have leftover files from an older version of Xcode.
You should delete them using:
/Developer/Library/uninstall-developer-folder
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libhelium_mac.a
Warning: Your Homebrew is not installed to /usr/local
You can install Homebrew anywhere you want, but some brews may only build
correctly if you install in /usr/local. Sorry!
Warning: You have a non-Homebrew 'pkg-config' in your PATH:
/opt/sm/pkg/active/bin/pkg-config
`./configure` may have problems finding brew-installed packages using
this other pkg-config.
And brew cask doctor:
==> OS X Release:
10.11
==> OS X Release with Patchlevel:
10.11.3
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p645
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 0.9.5 (git revision c7238; last commit 2016-03-09)
==> Homebrew Executable Path:
/Users/CalebKleveter/usr/local/bin/brew
==> Homebrew Cellar Path:
/Users/CalebKleveter/usr/local/Cellar
==> Homebrew Repository Path:
/Users/CalebKleveter/usr/local
==> Homebrew Origin:
https://github.com/Homebrew/homebrew
==> Homebrew-cask Version:
0.60.0 (git revision c16c; last commit 15 minutes ago)
==> Homebrew-cask Install Location:
<NONE>
==> Homebrew-cask Staging Location:
/opt/homebrew-cask/Caskroom (error: not writable by current user)
==> Homebrew-cask Cached Downloads:
/Library/Caches/Homebrew
/Library/Caches/Homebrew/Casks
2 files, 6M (warning: run "brew cask cleanup")
==> Homebrew-cask Default Tap Path:
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask
==> Homebrew-cask Alternate Cask Taps:
<NONE>
==> Homebrew-cask Default Tap Cask Count:
3006
==> Contents of $LOAD_PATH:
/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/lib
/Users/CalebKleveter/usr/local/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin15
/Library/Ruby/Site/2.0.0/universal-darwin15
/Library/Ruby/Site
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/x86_64-darwin15
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin15
==> Contents of $RUBYLIB Environment Variable:
<NONE>
==> Contents of $RUBYOPT Environment Variable:
<NONE>
==> Contents of $RUBYPATH Environment Variable:
<NONE>
==> Contents of $RBENV_VERSION Environment Variable:
<NONE>
==> Contents of $CHRUBY_VERSION Environment Variable:
<NONE>
==> Contents of $GEM_HOME Environment Variable:
<NONE>
==> Contents of $GEM_PATH Environment Variable:
<NONE>
==> Contents of $BUNDLE_PATH Environment Variable:
<NONE>
==> Contents of $PATH Environment Variable:
PATH="/Users/CalebKleveter/usr/local/bin:/Users/CalebKleveter/.nvm/versions/node/v5.6.0/bin:/Users/CalebKleveter/.rvm/gems/ruby-2.2.3/bin:/Users/CalebKleveter/.rvm/gems/ruby-2.2.3@global/bin:/Users/CalebKleveter/.rvm/rubies/ruby-2.2.3/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/git/bin:/opt/sm/bin:/opt/sm/pkg/active/bin:/opt/sm/pkg/active/sbin:/Users/CalebKleveter/.rvm/bin:/Users/CalebKleveter/usr/local/Library/Taps/caskroom/homebrew-cask/cmd:/Users/CalebKleveter/usr/local/Library/ENV/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/bin/bash"
==> Contents of Locale Environment Variables:
LANG="en_US.UTF-8"
==> Running As Privileged User:
No
I ran the command given, but that didn’t fix it.
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 16 (8 by maintainers)
Oh sorry, old instructions. Wipe cask
and just try
brew cask install virtualbox- Homebrew should handle everything else.Sorry about my confusion. I finally got it by creating a directory
Caskroomin my home and going into .bash_profile and adding:Thanks! This has really helped me! It really would be helpful if it were easier to find how to change homebrew-cask’s appdir.
It’s frustrating that a decision was taken to default to trying to install into /Applications, given how many of us use Homebrew without sudo.
I got a permission denied error when I ran
rm -rf '/opt/homebrew-cask'. Whenever I try to uninstall cask I getNo such keg: /Users/CalebKleveter/usr/local/Cellar/brew-cask. The issue remains.