title: Chocolatey Cannot uninstall a non-existent package
body: <p>A few days ago I installed vivaldi on my windows machine using chocolatey installing a package named vivaldi.install using <code>choco install vivaldi.install</code> because there wasn't any <code>choco install vivaldi</code> in the chocolatey webpage.<br>
  I made a test installing and uninstalling Krita and installing it again and didn't have any issues, using <code>choco install krita</code> before <code>choco uninstall krita</code> and ending with <code>choco install krita</code>
  Now I am trying to uninstall the browser using different commands that are listed below.<br>
  These are the ways i tried to type and do the same uninstalling action but i couldn't find a way<br>
  <code>choco uninstall 'vivaldi.install 3.6.2165.40'</code><br>
  <code>choco uninstall 'vivaldi.install 3.6.2165.40' --remove-dependencies</code><br><code> choco uninstall vivaldi.install</code><br>
  <code>choco uninstall vivaldi</code></p>
  <p>By the way typing <code>choco uninstall vivaldi.install 3.6.2165.40</code> without the apostrophes didn't work either because chocolatey tried to uninstall packages <em>vivaldi.install</em> and <em>3.6.2165.40</em></p>
  <p>First I tried in powershell as administrator to list every  installed package <br>
  <code>PS C:\WINDOWS\system32&gt; choco list --localonly</code> <br></p>
  <p>And got this<br></p>
  <pre><code>chocolatey 0.11.3
  chocolatey-core.extension 1.3.5.1
  chocolatey-dotnetfx.extension 1.0.1
  chocolatey-visualstudio.extension 1.10.0
  DotNet4.5.2 4.5.2.20140902
  dotnetfx 4.8.0.20190930
  Firefox 96.0.1
  KB2919355 1.0.20160915
  KB2919442 1.0.20160915
  microsoft-teams 1.4.00.32771
  peazip 8.4.0
  peazip.install 8.4.0
  visualstudio-installer 2.0.2
  visualstudio2022community 117.0.5.0
  vivaldi.install 3.6.2165.40
  vscodium 1.63.2
  vscodium.install 1.63.2
  17 packages installed.
  Did you know Pro / Business automatically syncs with Programs and
   Features? Learn more about Package Synchronizer at
   https://chocolatey.org/compare
  </code></pre>
  <p>Then tried to uninstall the package as it was listed between apostrophes to include the version it was listed with although as far as I know it should be enough with the word vivaldi or vivaldi.install considering actual package name, after this code there are the other ways i tried<br>
  <code>PS C:\WINDOWS\system32&gt; choco uninstall 'vivaldi.install 3.6.2165.40'</code></p>
  
  
  <pre><code>Chocolatey v0.11.3
  Uninstalling the following packages:
  vivaldi.install 3.6.2165.40
  vivaldi.install 3.6.2165.40 is not installed. Cannot uninstall a non-existent package.
  
  Chocolatey uninstalled 0/1 packages. 1 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
  
  Failures
   - vivaldi.install 3.6.2165.40 - vivaldi.install 3.6.2165.40 is not installed. Cannot uninstall a non-existent package.
  
  If a package uninstall is failing and/or you've already uninstalled the
   software outside of Chocolatey, you can attempt to run the command
   with `-n` to skip running a chocolateyUninstall script, additionally
   adding `--skip-autouninstaller` to skip an attempt to automatically
   remove system-installed software. Only the packaging files are removed
   and not things like software installed to Programs and Features.
  
  If a package is failing because it is a dependency of another package
   or packages, then you may first need to consider if it needs to be
   removed as packages have dependencies for a reason. If
   you decide that you still want to remove it, head into
   `$env:ChocolateyInstall\lib` and find the package folder you want to
   be removed. Then delete the folder for the package. You should use
   this option only as a last resort.
  </code></pre>
  
  <p>Then tried doing the same but also removing dependencies<br>
  <code>PS C:\WINDOWS\system32&gt; choco uninstall 'vivaldi.install 3.6.2165.40' --remove-dependencies</code></p>
  
  
  <pre><code>Chocolatey v0.11.3
  Uninstalling the following packages:
  vivaldi.install 3.6.2165.40
  vivaldi.install 3.6.2165.40 is not installed. Cannot uninstall a non-existent package.
  
  Chocolatey uninstalled 0/1 packages. 1 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
  
  Failures
   - vivaldi.install 3.6.2165.40 - vivaldi.install 3.6.2165.40 is not installed. Cannot uninstall a non-existent package.
  
  If a package uninstall is failing and/or you've already uninstalled the
   software outside of Chocolatey, you can attempt to run the command
   with `-n` to skip running a chocolateyUninstall script, additionally
   adding `--skip-autouninstaller` to skip an attempt to automatically
   remove system-installed software. Only the packaging files are removed
   and not things like software installed to Programs and Features.
  
  If a package is failing because it is a dependency of another package
   or packages, then you may first need to consider if it needs to be
   removed as packages have dependencies for a reason. If
   you decide that you still want to remove it, head into
   `$env:ChocolateyInstall\lib` and find the package folder you want to
   be removed. Then delete the folder for the package. You should use
   this option only as a last resort.
  </code></pre>
  
  <p>I also tried other ways like writing only the package name vivaldi.install<br>
  <code>PS C:\WINDOWS\system32&gt; choco uninstall vivaldi.install</code> <br></p>
  
  
  <pre><code>Chocolatey v0.11.3
  Uninstalling the following packages:
  vivaldi.install
  
  vivaldi.install v3.6.2165.40
  The package vivaldi.install wants to run 'chocolateyuninstall.ps1'.
  Note: If you don't run this script, the installation will fail.
  Note: To confirm automatically next time, use '-y' or consider:
  choco feature enable -n allowGlobalConfirmation
  Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): y
  
  ERROR: You cannot call a method on a null-valued expression.
  vivaldi.install uninstall not successful.
  Error while running 'C:\ProgramData\chocolatey\lib\vivaldi.install\tools\chocolateyuninstall.ps1'.
   See log for details.
  vivaldi.install not uninstalled. An error occurred during uninstall:
   vivaldi.install uninstall not successful.
  
  Chocolatey uninstalled 0/1 packages. 1 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
  
  Failures
   - vivaldi.install (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\vivaldi.install\tools\chocolateyuninstall.ps1'.
   See log for details.
  
  If a package uninstall is failing and/or you've already uninstalled the
   software outside of Chocolatey, you can attempt to run the command
   with `-n` to skip running a chocolateyUninstall script, additionally
   adding `--skip-autouninstaller` to skip an attempt to automatically
   remove system-installed software. Only the packaging files are removed
   and not things like software installed to Programs and Features.
  
  If a package is failing because it is a dependency of another package
   or packages, then you may first need to consider if it needs to be
   removed as packages have dependencies for a reason. If
   you decide that you still want to remove it, head into
   `$env:ChocolateyInstall\lib` and find the package folder you want to
   be removed. Then delete the folder for the package. You should use
   this option only as a last resort.
  </code></pre>
  
  <p>Also tried using only the name of the program<br>
  <code>PS C:\WINDOWS\system32&gt; choco uninstall vivaldi</code><br></p>
  
  
  <pre><code>Chocolatey v0.11.3
  Uninstalling the following packages:
  vivaldi
  You are uninstalling vivaldi, which is likely a metapackage for an
   *.install/*.portable package that it installed
   (vivaldi represents discoverability).
  Would you like to uninstall vivaldi.install as well?([Y]es/[N]o): y
  
  vivaldi is not installed. Cannot uninstall a non-existent package.
  
  vivaldi.install v3.6.2165.40
  The package vivaldi.install wants to run 'chocolateyuninstall.ps1'.
  Note: If you don't run this script, the installation will fail.
  Note: To confirm automatically next time, use '-y' or consider:
  choco feature enable -n allowGlobalConfirmation
  Do you want to run the script?([Y]es/[A]ll - yes to all/[N]o/[P]rint): y
  
  ERROR: You cannot call a method on a null-valued expression.
  vivaldi.install uninstall not successful.
  Error while running 'C:\ProgramData\chocolatey\lib\vivaldi.install\tools\chocolateyuninstall.ps1'.
   See log for details.
  vivaldi.install not uninstalled. An error occurred during uninstall:
   vivaldi.install uninstall not successful.
  
  Chocolatey uninstalled 0/2 packages. 2 packages failed.
   See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).
  
  Failures
   - vivaldi.install (exited -1) - Error while running 'C:\ProgramData\chocolatey\lib\vivaldi.install\tools\chocolateyuninstall.ps1'.
   See log for details.
   - vivaldi - vivaldi is not installed. Cannot uninstall a non-existent package.
  
  If a package uninstall is failing and/or you've already uninstalled the
   software outside of Chocolatey, you can attempt to run the command
   with `-n` to skip running a chocolateyUninstall script, additionally
   adding `--skip-autouninstaller` to skip an attempt to automatically
   remove system-installed software. Only the packaging files are removed
   and not things like software installed to Programs and Features.
  
  If a package is failing because it is a dependency of another package
   or packages, then you may first need to consider if it needs to be
   removed as packages have dependencies for a reason. If
   you decide that you still want to remove it, head into
   `$env:ChocolateyInstall\lib` and find the package folder you want to
   be removed. Then delete the folder for the package. You should use
   this option only as a last resort.
  </code></pre>
  <br><br>
  <p><strong>Edit 03/30/2022</strong> reply to @LDStewart <br>
  <br>
  I reset my pc reinstalling windows with the configuration panel because vivaldi was still listed on chocolatey even though I uninstalled it with the apps and features panel. That's how I fixed the problem.<br>
  I experimented with a virtual machine today installing, uninstalling and listing with the same <code>vivaldi.install</code> package that presented the problem and didn't have the &quot;cannot uninstall non existent package&quot; issue, it looks like is was fixed because it uninstalled successfully the single package that was installed(<code>vivaldi.install</code> package). <br>
  And also it looks like the <code>vivaldi</code> package have been recently created by the package maintainer (instead of the <code>vivaldi.install</code> package). Both packages(<code>vivaldi.install</code> and <code>vivaldi</code>) are ok and working when talking about installing and uninstalling.</p>