1. 程式人生 > 其它 >解決Macos下brew無法更新chrome的問題

解決Macos下brew無法更新chrome的問題

2019獨角獸企業重金招聘Python工程師標準>>> hot3.png

最近看到chrome64出來了就使用brew cask 更新,然而報錯,使用brew-cask刪除chrome也報同樣的錯誤:

==> Moving App 'Google Chrome.app' back to '/usr/local/Caskroom/google-chrome/latest/Google Chrome.app'.
Error: Permission denied @ rb_file_s_rename - (/Applications/Google Chrome.app, /usr/local/Caskroom/google-chrome/latest/Google Chrome.app)
Follow the instructions here:
  https://github.com/caskroom/homebrew-cask#reporting-bugs
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:528:in `rename'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:528:in `block in mv'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1571:in `block in fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1587:in `fu_each_src_dest0'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:1569:in `fu_each_src_dest'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/fileutils.rb:517:in `mv'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/moved.rb:69:in `move_back'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/artifact/moved.rb:15:in `uninstall_phase'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:403:in `block in uninstall_artifacts'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/2.3.0/set.rb:674:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:400:in `uninstall_artifacts'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/installer.rb:353:in `uninstall'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb:22:in `block in run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb:12:in `each'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb:12:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/abstract_command.rb:35:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:98:in `run_command'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:168:in `run'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli.rb:132:in `run'
/usr/local/Homebrew/Library/Homebrew/cmd/cask.rb:8:in `cask'
/usr/local/Homebrew/Library/Homebrew/brew.rb:100:in `<main>'

查看了下/Applications目錄發現chrome的使用者和組都很奇怪,並不像其他用brew安裝的程式

[email protected]  3 root  wheel    96B Feb  1 11:00 Google Chrome.app
drwxr-xr-x   3 root  admin    96B Nov 26 23:02 VirtualBox.app

vbox是可以正常更新的,於是修改了chrome的組仍然無法解決, 遂刪除之

cd /Applications/
sudo rm -rf Google\ Chrome.app/

在使用brew-cask重新安裝brew cask reinstall google-chrome

$ brew cask reinstall google-chrome
==> Satisfying dependencies
==> Downloading https://dl.google.com/chrome/mac/stable/GGRO/googlechrome.dmg
Already downloaded: /Users/eddy/Library/Caches/Homebrew/Cask/google-chrome--64.0.3282.140.dmg
==> Verifying checksum for Cask google-chrome
==> Uninstalling Cask google-chrome
==> Purging files for version latest of Cask google-chrome
==> Installing Cask google-chrome
==> Moving App 'Google Chrome.app' to '/Applications/Google Chrome.app'.