Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Permission denied - /opt/homebrew-cask/Caskroom/(application) #15622

Closed
jeffmarka opened this issue Dec 5, 2015 · 5 comments
Closed

Comments

@jeffmarka
Copy link

Unable to install applications.

Already ran:

brew update && brew upgrade brew-cask && brew cleanup && brew cask cleanup

@adidalal
Copy link
Contributor

adidalal commented Dec 5, 2015

First, make sure brew doctor has no errors.

Please post the output of brew cask doctor and sudo ls -arlt /opt/homebrew-cask

@adidalal adidalal added bug Issue describing a reproducible bug. awaiting user reply Issue needs response from a user. and removed bug Issue describing a reproducible bug. labels Dec 5, 2015
@jeffmarka
Copy link
Author

From brew doctor:

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/ublio.h

Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so
    echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile

From brew cask doctor:

==> OS X Release:
10.11
==> OS X Release with Patchlevel:
10.11.1
==> 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:
0.9.5 (git revision 12f4; last commit 2015-12-06)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local
==> Homebrew Origin:
https://github.com/Homebrew/homebrew
==> Homebrew-cask Version:
0.59.0
==> Homebrew-cask Install Location:
/usr/local/Cellar/brew-cask/0.59.0
==> 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
4 files (warning: run "brew cask cleanup")
84.61 megs (warning: run "brew cask cleanup")
==> Homebrew-cask Default Tap Path:
/usr/local/Library/Taps/caskroom/homebrew-cask
==> Homebrew-cask Alternate Cask Taps:
<NONE>
==> Homebrew-cask Default Tap Cask Count:
2903
==> Contents of $LOAD_PATH:
/usr/local/Cellar/brew-cask/0.59.0/rubylib
/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="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/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

Thank you for your helping!

@adidalal
Copy link
Contributor

adidalal commented Dec 7, 2015

Ah, I see it's a permissions error: /opt/homebrew-cask/Caskroom (error: not writable by current user)

Can you please check if sudo ls -arlt /opt/homebrew-cask gives you an output like:

[~] > sudo ls -arlt /opt/homebrew-cask
Password:
total 24
drwxr-xr-x   4 aditya  staff   136 Oct  4 14:31 .
drwxrwxr-x@  4 root    wheel   136 Nov 19 09:40 ..
-rw-r--r--@  1 aditya  staff  8196 Nov 29 12:50 .DS_Store
drwxr-xr-x  24 aditya  staff   816 Dec  6 10:25 Caskroom

If they don't look like that, let's fix that, run:

sudo mkdir -p /opt/homebrew-cask/Caskroom
sudo chown -R ${USER}:staff /opt/homebrew-cask

Try running brew update && brew upgrade -all && brew cleanup && brew cask cleanup after that. If there are no errors, you're good to go.

And finally, if that still doesn't work, the "nuclear" option is:

# NOTE: this will wipe homebrew-cask
brew uninstall brew-cask
brew untap caskroom/cask
sudo rm -rf '/opt/homebrew-cask'
brew install caskroom/cask/brew-cask

Please let us know your results.

@adidalal
Copy link
Contributor

adidalal commented Dec 9, 2015

Closing due to lack of reply

@adidalal adidalal closed this as completed Dec 9, 2015
@jdemonasterio
Copy link

Thanks @adidalal . It worked for me without needing to use the Nuclear option.

@adidalal adidalal removed the awaiting user reply Issue needs response from a user. label Apr 12, 2016
@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants