1

几天前,我在我的 Windows 机器上安装了 vivaldi,使用巧克力安装了一个名为 vivaldi.install 的软件包,因为巧克力网页choco install vivaldi.install中没有任何软件包。 我进行了安装和卸载 Krita 的测试,然后再次安装,没有任何问题,使用之前和结尾 现在我正在尝试使用下面列出的不同命令卸载浏览器。 这些是我尝试输入并执行相同卸载操作的方式,但我找不到方法choco install vivaldi
choco install kritachoco uninstall kritachoco install krita

choco uninstall 'vivaldi.install 3.6.2165.40'
choco uninstall 'vivaldi.install 3.6.2165.40' --remove-dependencies
choco uninstall vivaldi.install
choco uninstall vivaldi

顺便说一句choco uninstall vivaldi.install 3.6.2165.40,没有撇号的打字也不起作用,因为巧克力试图卸载软件包vivaldi.install3.6.2165.40

首先,我尝试以管理员身份在 powershell 中列出每个已安装的软件包
PS C:\WINDOWS\system32> choco list --localonly

得到了这个

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

然后尝试卸载该软件包,因为它在撇号之间列出以包括它列出的版本,尽管据我所知,考虑到实际的软件包名称,使用 vivaldi 或 vivaldi.install 这个词就足够了,在此代码之后还有其他我试过的方法
PS C:\WINDOWS\system32> choco uninstall 'vivaldi.install 3.6.2165.40'

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.

然后尝试做同样的事情但也删除依赖项
PS C:\WINDOWS\system32> choco uninstall 'vivaldi.install 3.6.2165.40' --remove-dependencies

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.

我还尝试了其他方法,比如只写包名 vivaldi.install
PS C:\WINDOWS\system32> choco uninstall vivaldi.install

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.

还尝试仅使用程序名称
PS C:\WINDOWS\system32> choco uninstall vivaldi

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.
4

0 回答 0