When uninstalling vagrant on Catalina the uninstall script found in /usr/local/Caskroom/vagrant/2.2.5/uninstall.tool has a part that doesn't bring up the GUI request.
It does pop up if I run it manually.
-# Use AppleScript so we can use a graphical sudo prompt.
-# This way, people can enter the username they wish to use
-# for sudo, and it is more Apple-like.
osascript -e "do shell script \"/bin/rm -Rf ${my_files[*]}\" with administrator privileges"
Command that failed
brew cask reinstall vagrant
Output of command with --force --verbose --debug
brew cask reinstall --force --verbose --debug vagrant
==> Cask::Installer#reinstall
==> Cask::Installer#install
==> Printing caveats
==> Cask::Installer#fetch
==> Downloading
==> Downloading https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.dmg
/usr/bin/curl -q --globoff --show-error --user-agent Homebrew/2.1.15-116-g33330ba\ \(Macintosh\;\ Intel\ Mac\ OS\ X\ 10.15\)\ curl/7.64.1 --location --silent --head --request GET https://releases.hashicorp.com/vagrant/2.2.6/vagrant_2.2.6_x86_64.dmg
Already downloaded: /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg
==> Checking quarantine support
/usr/bin/xattr
/usr/bin/swift /usr/local/Homebrew/Library/Homebrew/cask/utils/quarantine.swift
==> Quarantine is available.
==> Verifying Gatekeeper status of /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg
/usr/bin/xattr -p com.apple.quarantine /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg
==> /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg is quarantined
==> Downloaded to -> /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg
==> Verifying SHA-256 checksum for Cask 'vagrant'.
hdiutil imageinfo -format /Users/Gene/Library/Caches/Homebrew/downloads/02a35a68bfe45a4ffee2e9b601c1a44731e67d49cc52fd6c6d82070b7b85108e--vagrant_2.2.6_x86_64.dmg
==> Uninstalling Cask vagrant
==> Uninstalling artifacts
==> 3 artifact/s defined
#<SortedSet: {#<Cask::Artifact::Uninstall:0x00007fb54b2a9bc8 @cask=#<Cask::Cask:0x00007fb54b299188 @token="vagrant", @sourcefile_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb>, @tap=nil, @block=#<Proc:0x00007fb54b299020@/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb:1>, @caskroom_path=#<Pathname:/usr/local/Caskroom/vagrant>, @metadata_master_container_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata>, @config=#<Cask::Config:0x00007fb54b2904c0 @default={:appdir=>#<Pathname:/Applications>, :prefpanedir=>#<Pathname:/Users/Gene/Library/PreferencePanes>, :qlplugindir=>#<Pathname:/Users/Gene/Library/QuickLook>, :dictionarydir=>#<Pathname:/Users/Gene/Library/Dictionaries>, :fontdir=>#<Pathname:/Users/Gene/Library/Fonts>, :colorpickerdir=>#<Pathname:/Users/Gene/Library/ColorPickers>, :servicedir=>#<Pathname:/Users/Gene/Library/Services>, :input_methoddir=>#<Pathname:/Users/Gene/Library/Input Methods>, :internet_plugindir=>#<Pathname:/Users/Gene/Library/Internet Plug-Ins>, :audio_unit_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/Components>, :vst_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST>, :vst3_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST3>, :screen_saverdir=>#<Pathname:/Users/Gene/Library/Screen Savers>}, @env={}, @explicit={}>, @dsl=#<Cask::DSL:0x00007fb54b2a1040 @cask=#<Cask::Cask:0x00007fb54b299188 ...>, @token="vagrant", @version="2.2.5", @sha256="b7960721440e4ea7b5bac3ba172ea5a2c11e4d82485b55255556601a4488f2c2", @url=#<URL:0x00007fb54b2a07a8 @uri=#<URI::HTTPS https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.dmg>, @user_agent=:default, @specs={}>, @appcast=#<Cask::DSL::Appcast:0x00007fb54b2a0208 @uri=#<URI::HTTPS https://github.com/hashicorp/vagrant/releases.atom>, @parameters={}>, @name=["Vagrant"], @homepage="https://www.vagrantup.com/", @artifacts=#<SortedSet: {...}>, @staged_path=#<Pathname:/usr/local/Caskroom/vagrant/2.2.5>, @language=nil>>, @directives={:script=>{:executable=>"uninstall.tool", :input=>["Yes"], :sudo=>true}, :pkgutil=>"com.vagrant.vagrant", :signal=>[]}>, #<Cask::Artifact::Pkg:0x00007fb54b2ab7e8 @cask=#<Cask::Cask:0x00007fb54b299188 @token="vagrant", @sourcefile_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb>, @tap=nil, @block=#<Proc:0x00007fb54b299020@/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb:1>, @caskroom_path=#<Pathname:/usr/local/Caskroom/vagrant>, @metadata_master_container_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata>, @config=#<Cask::Config:0x00007fb54b2904c0 @default={:appdir=>#<Pathname:/Applications>, :prefpanedir=>#<Pathname:/Users/Gene/Library/PreferencePanes>, :qlplugindir=>#<Pathname:/Users/Gene/Library/QuickLook>, :dictionarydir=>#<Pathname:/Users/Gene/Library/Dictionaries>, :fontdir=>#<Pathname:/Users/Gene/Library/Fonts>, :colorpickerdir=>#<Pathname:/Users/Gene/Library/ColorPickers>, :servicedir=>#<Pathname:/Users/Gene/Library/Services>, :input_methoddir=>#<Pathname:/Users/Gene/Library/Input Methods>, :internet_plugindir=>#<Pathname:/Users/Gene/Library/Internet Plug-Ins>, :audio_unit_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/Components>, :vst_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST>, :vst3_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST3>, :screen_saverdir=>#<Pathname:/Users/Gene/Library/Screen Savers>}, @env={}, @explicit={}>, @dsl=#<Cask::DSL:0x00007fb54b2a1040 @cask=#<Cask::Cask:0x00007fb54b299188 ...>, @token="vagrant", @version="2.2.5", @sha256="b7960721440e4ea7b5bac3ba172ea5a2c11e4d82485b55255556601a4488f2c2", @url=#<URL:0x00007fb54b2a07a8 @uri=#<URI::HTTPS https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.dmg>, @user_agent=:default, @specs={}>, @appcast=#<Cask::DSL::Appcast:0x00007fb54b2a0208 @uri=#<URI::HTTPS https://github.com/hashicorp/vagrant/releases.atom>, @parameters={}>, @name=["Vagrant"], @homepage="https://www.vagrantup.com/", @artifacts=#<SortedSet: {...}>, @staged_path=#<Pathname:/usr/local/Caskroom/vagrant/2.2.5>, @language=nil>>, @path=#<Pathname:/usr/local/Caskroom/vagrant/2.2.5/vagrant.pkg>, @stanza_options={}>, #<Cask::Artifact::Zap:0x00007fb54b2a91f0 @cask=#<Cask::Cask:0x00007fb54b299188 @token="vagrant", @sourcefile_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb>, @tap=nil, @block=#<Proc:0x00007fb54b299020@/usr/local/Caskroom/vagrant/.metadata/2.2.5/20190626214513.336/Casks/vagrant.rb:1>, @caskroom_path=#<Pathname:/usr/local/Caskroom/vagrant>, @metadata_master_container_path=#<Pathname:/usr/local/Caskroom/vagrant/.metadata>, @config=#<Cask::Config:0x00007fb54b2904c0 @default={:appdir=>#<Pathname:/Applications>, :prefpanedir=>#<Pathname:/Users/Gene/Library/PreferencePanes>, :qlplugindir=>#<Pathname:/Users/Gene/Library/QuickLook>, :dictionarydir=>#<Pathname:/Users/Gene/Library/Dictionaries>, :fontdir=>#<Pathname:/Users/Gene/Library/Fonts>, :colorpickerdir=>#<Pathname:/Users/Gene/Library/ColorPickers>, :servicedir=>#<Pathname:/Users/Gene/Library/Services>, :input_methoddir=>#<Pathname:/Users/Gene/Library/Input Methods>, :internet_plugindir=>#<Pathname:/Users/Gene/Library/Internet Plug-Ins>, :audio_unit_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/Components>, :vst_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST>, :vst3_plugindir=>#<Pathname:/Users/Gene/Library/Audio/Plug-Ins/VST3>, :screen_saverdir=>#<Pathname:/Users/Gene/Library/Screen Savers>}, @env={}, @explicit={}>, @dsl=#<Cask::DSL:0x00007fb54b2a1040 @cask=#<Cask::Cask:0x00007fb54b299188 ...>, @token="vagrant", @version="2.2.5", @sha256="b7960721440e4ea7b5bac3ba172ea5a2c11e4d82485b55255556601a4488f2c2", @url=#<URL:0x00007fb54b2a07a8 @uri=#<URI::HTTPS https://releases.hashicorp.com/vagrant/2.2.5/vagrant_2.2.5_x86_64.dmg>, @user_agent=:default, @specs={}>, @appcast=#<Cask::DSL::Appcast:0x00007fb54b2a0208 @uri=#<URI::HTTPS https://github.com/hashicorp/vagrant/releases.atom>, @parameters={}>, @name=["Vagrant"], @homepage="https://www.vagrantup.com/", @artifacts=#<SortedSet: {...}>, @staged_path=#<Pathname:/usr/local/Caskroom/vagrant/2.2.5>, @language=nil>>, @directives={:trash=>"~/.vagrant.d", :signal=>[]}>}>
==> Uninstalling artifact of class Cask::Artifact::Uninstall
==> Running uninstall script uninstall.tool
/usr/bin/sudo -E -- /usr/local/Caskroom/vagrant/2.2.5/uninstall.tool
Password:
+ my_files=()
+ append my_files /opt/vagrant
+ eval 'my_files[${#my_files[*]}]=/opt/vagrant'
++ my_files[${#my_files[*]}]=/opt/vagrant
+ append my_files /usr/local/bin/vagrant
+ eval 'my_files[${#my_files[*]}]=/usr/local/bin/vagrant'
The following files and directories will be removed:
++ my_files[${#my_files[*]}]=/usr/local/bin/vagrant
/opt/vagrant
+ echo 'The following files and directories will be removed:'
/usr/local/bin/vagrant
+ for file in '"${my_files[@]}"'
+ echo ' /opt/vagrant'
Do you wish to uninstall Vagrant (Yes/No)?
+ for file in '"${my_files[@]}"'
The uninstallation process requires administrative privileges
+ echo ' /usr/local/bin/vagrant'
because some of the installed files cannot be removed by a
+ echo ''
normal user. You may now be prompted for a password...
+ echo 'Do you wish to uninstall Vagrant (Yes/No)?'
+ read my_answer
+ '[' Yes '!=' Yes ']'
+ echo 'The uninstallation process requires administrative privileges'
+ echo 'because some of the installed files cannot be removed by a'
+ echo 'normal user. You may now be prompted for a password...'
+ echo ''
+ osascript -e 'do shell script "/bin/rm -Rf /opt/vagrant /usr/local/bin/vagrant" with administrator privileges'
General troubleshooting steps
--force
.brew update-reset && brew update
and retried my command.brew doctor
, fixed as many issues as possible and retried my command.Description of issue
When uninstalling vagrant on Catalina the uninstall script found in /usr/local/Caskroom/vagrant/2.2.5/uninstall.tool has a part that doesn't bring up the GUI request. It does pop up if I run it manually.
-# Use AppleScript so we can use a graphical
sudo
prompt. -# This way, people can enter the username they wish to use -# for sudo, and it is more Apple-like. osascript -e "do shell script \"/bin/rm -Rf ${my_files[*]}\" with administrator privileges"Command that failed
Output of command with
--force --verbose --debug
Output of
brew cask doctor
Output of
brew tap