Homebrew / homebrew-cask

🍻 A CLI workflow for the administration of macOS applications distributed as binaries
https://brew.sh
BSD 2-Clause "Simplified" License
20.84k stars 10.67k forks source link

it's another permission bug #25547

Closed palindrom615 closed 7 years ago

palindrom615 commented 7 years ago

permission message when I install a cask, like this: brew cask install vlc

and this is the output.

==> Downloading https://get.videolan.org/vlc/2.2.4/macosx/vlc-2.2.4.dmg
Error: Download failed on Cask 'vlc' with message: Permission denied - /Users/palindrom615/Library/Caches/Homebrew/Cask/vlc--2.2.4.dmg.incomplete

I untabbed and reinstalled brew-cask a few times and nothing changed. both brew and brew cask are already-updated. nothing special on brew doctor and here's what brew cask doctor

==> macOS Release:
10.12
==> Hardware Architecture:
intel-64
==> Ruby Version:
2.0.0-p648
==> Ruby Path:
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby
==> Homebrew Version:
Homebrew 1.0.7
Homebrew/homebrew-core (git revision 552e; last commit 2016-10-16)
==> Homebrew Executable Path:
/usr/local/bin/brew
==> Homebrew Cellar Path:
/usr/local/Cellar
==> Homebrew Repository Path:
/usr/local/Homebrew
==> Homebrew Origin:
https://github.com/Homebrew/brew
==> Homebrew-Cask Version:
Homebrew-Cask 1.0.7
caskroom/homebrew-cask (git revision 8697; last commit 2016-10-16)
==> Homebrew-Cask Install Location:
<NONE>
==> Homebrew-Cask Staging Location:
/Users/palindrom615/Caskroom
==> Homebrew-Cask Cached Downloads:
/Users/palindrom615/Library/Caches/Homebrew/Cask
10 files, 7M (warning: run "brew cask cleanup")
==> Homebrew-Cask Default Tap Path:
/usr/local/Homebrew/Library/Taps/caskroom/homebrew-cask
==> Homebrew-Cask Alternate Cask Taps:
==> Homebrew-Cask Default Tap Cask Count:
3390
==> Contents of $LOAD_PATH:
/usr/local/Homebrew/Library/Homebrew/cask/lib
/usr/local/Homebrew/Library/Homebrew
/Library/Ruby/Site/2.0.0
/Library/Ruby/Site/2.0.0/x86_64-darwin16
/Library/Ruby/Site/2.0.0/universal-darwin16
/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-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/vendor_ruby/2.0.0/universal-darwin16
/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-darwin16
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/universal-darwin16
==> 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/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Applications/Server.app/Contents/ServerRoot/usr/bin:/Applications/Server.app/Contents/ServerRoot/usr/sbin:/usr/local/Homebrew/Library/Homebrew/cask/cmd:/usr/local/Homebrew/Library/Homebrew/shims/scm"
==> Contents of $SHELL Environment Variable:
SHELL="/bin/zsh"
==> Contents of Locale Environment Variables:
LANG="ko_KR.UTF-8"
LC_ALL="ko_KR.UTF-8"
==> Running As Privileged User:
No

and brew cask cleanup just say permission denied again. brew cleanup work. here's what they say.

==> Removing cached downloads
/Users/palindrom615/Library/Caches/Homebrew/Cask/betterzipql--latest.zip
Error: Permission denied - /Users/palindrom615/Library/Caches/Homebrew/Cask/betterzipql--latest.zipMost likely, this means you have an outdated version of Homebrew-Cask. Please run:
  brew uninstall --force brew-cask; brew untap phinze/cask; brew untap caskroom/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

/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:100:in `unlink'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:100:in `unlink'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:100:in `block in delete_paths'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:90:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:90:in `delete_paths'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:84:in `remove_cache_files'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:34:in `cleanup!'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb:17:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:109:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:148:in `process'
/usr/local/Homebrew/Library/Homebrew/cask/cmd/brew-cask.rb:8:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/usr/local/Homebrew/Library/Homebrew/brew.rb:24:in `require?'
/usr/local/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'
vitorgalvao commented 7 years ago

You must always follow the reporting bugs guide. When you opened this issue, the template in place urged you to do so and gave you the relevant links.

Closing, since this issue doesn’t even contain any information.

palindrom615 commented 7 years ago

I'm so sorry about that. I pressed enter mistakenly.

vitorgalvao commented 7 years ago

What’s the output of ls -la "${HOME}/Library/Caches/Homebrew"?

palindrom615 commented 7 years ago

This is some part of output of ls -la "${HOME}/Library/Caches/Homebrew". Maybe no need to paste all of them...

total 855248
drwxrwxr-x  78 palindrom615  staff       2652 10 17 00:40 .
drwx------+ 69 palindrom615  staff       2346 10 17 00:47 ..
drwxr-xr-x  12 root          staff        408  8 15 00:15 Cask
-rw-r--r--   1 root          staff      11263  9 27 00:04 archey-1.6.0.tar.gz
-rw-r--r--   1 root          staff      16148  4  9  2016 bchunk-1.2.0.el_capitan.bottle.tar.gz
-rw-r--r--   1 palindrom615  staff     668343  9 11 11:41 bison-3.0.4.sierra.bottle.tar.gz
-rw-r--r--   1 root          staff    1687396  2 16  2016 cairo-1.14.6_1.el_capitan.bottle.tar.gz
-rw-r--r--   1 palindrom615  staff    1687906  9 10 09:30 cairo-1.14.6_1.sierra.bottle.tar.gz
-rw-r--r--   1 palindrom615  staff     310628 10 17 00:40 cask-0.8.0.tar.gz
-rw-r--r--   1 palindrom615  staff   10572591  9 10 01:22 cmake-3.6.2.sierra.bottle.tar.gz
-rw-r--r--   1 root          staff      31961 10 10 01:49 cowsay-3.04.tar.gz
...
jawshooah commented 7 years ago

drwxr-xr-x 12 root staff 408 8 15 00:15 Cask

There's your problem. Why is this directory owned by root? For that matter, why are several of your Homebrew bottles owned by root?

Just sudo chown -R "${USER}:staff" "${HOME}/Library/Caches/Homebrew" and try again.

palindrom615 commented 7 years ago

I sometimes used brew as su and maybe that's why. It solved! Thanks very much!

jawshooah commented 7 years ago

I sometimes used brew as su and maybe that's why.

Yup, that's why. Don't do that! :wink: