在OS X El Capitan 10.11.6上,我有
$ VirtualBox --help
Oracle VM VirtualBox Manager 5.0.16
我正在尝试卸载virtual box
但是正在关注...
brew cask uninstall --force virtualbox
Error: undefined method `<=' for nil:NilClass
Did you mean? <=>
Follow the instructions here:
https://github.com/caskroom/homebrew-cask#reporting-bugs
/usr/local/Caskroom/virtualbox/.metadata/5.0.16-105871/20160414170649.906/Casks/virtualbox.rb:2:in `block in load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:23:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask.rb:23:in `initialize'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:29:in `new'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:29:in `cask'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:65:in `cask'
/usr/local/Homebrew/Library/Homebrew/compat/hbc/cask_loader.rb:10:in `cask'
/usr/local/Caskroom/virtualbox/.metadata/5.0.16-105871/20160414170649.906/Casks/virtualbox.rb:1:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:55:in `instance_eval'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:55:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cask_loader.rb:168:in `load'
/usr/local/Homebrew/Library/Homebrew/cask/lib/hbc/cli/uninstall.rb:19: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>'
这是它抱怨的文件的第一行:
cat /usr/local/Caskroom/virtualbox/.metadata/5.0.16-105871/20160414170649.906/Casks/virtualbox.rb
cask 'virtualbox' do
if MacOS.release <= :lion
有任何想法吗 ?
打开终端并运行以下命令
brew update
brew cleanup
用brew删除所有包
brew cask rm virtualbox --force
brew cask rm vagrant --force
brew cask rm vagrant-manager --force
删除可能遗漏的任何现有包
rm -rf /Applications/Vagrant* /Applications/VirtualBox
sudo rm -f /usr/bin/vagrant /usr/local/bin/vagrant
sudo rm -rf /opt/vagrant /opt/homebrew-cask/Caskroom/va* /opt/homebrew-cask/Caskroom/virtualbox
rm -rf ~/.vagrant* ~/.docker ~/Virtual*
rm -rf /usr/local/Caskroom/virtualbox && rm -rf /Applications/VirtualBox.app/
sudo pkgutil --forget com.vagrant.vagrant
更新:如果要重新安装它,请运行以下命令
brew cleanup
brew update --rebase
brew upgrade --cleanup
brew install vagrant-completion --force
brew cask install virtualbox --force
brew cask install vagrant --force
brew cask install vagrant-manager --force
brew upgrade --cleanup
brew cleanup
brew doctor
sudo shutdown -r now
从旧的virtualbox.rb脚本中删除对MacOS.release的违规调用后,卸载virtualbox对我有用。该文件应该是这样的:
/US人/local/CAS开room/VirtualBox/.metadata/5.0.14-105127/20160220202816.699/casks/VirtualBox.日本
使用文本编辑器,删除if语句,并仅保留选择已安装的5.0.14版本的分支。之后,brew应该能够解析,然后使用简单的方法卸载旧的virtualbox桶
brew cask uninstall virtualbox