我怎样才能找到我的计算机上已经安装的具有巧克力等价物的软件包?

How can I find packages already installed on my computer that have a chocolatey equivalent?

我想用相应的巧克力包替换我电脑上的许多包,这样它们就可以自动升级了。

是否有可能扫描已安装的应用程序并指出其中哪些应用程序具有巧克力等价物?

非常感谢!

是的,但这可能不是您想听到的。

您可以使用 Package Synchronization feature, but this feature requires a Chocolatey for Business license (C4B). Automatic Synchronization 类似命名的功能(所有付费许可证都有),但这只会删除在 Chocolatey 之外卸载相关软件的软件包。


对于免费版本,您将不得不手动同步您的包状态。

Note: I don't recommend doing this for packages you don't maintain on the community feed. The likelihood of getting malware is low, but I'd be more concerned with a poor search term causing the wrong package to get installed instead, or accidentally installing a less "official" package maintained by someone who does not who is not as diligent with updates or has abandoned the package.

However, this should be a perfectly safe procedure for packages you develop and maintain (and in reality you'll probably know all the package ids and versions anyways, so you'll skip straight to step 3). Doubly so if you are installing from a private feed you or your organization controls.

  1. 从 Windows 查询您安装的程序。记下您安装的版本,以便安装正确的版本。
  2. 对每一个进行包搜索,记录每个包的包ID。
    • choco list --order-by-popularity --version VERSION 应该可以帮助您避免同一软件的官方或维护较少的软件包,并为您提供正确的软件包版本。榜首最受欢迎。
    • 这并不完美,因为某些软件实际上只能通过单个版本的软件包安装,但要么自行更新,要么从最新的 URL 中提取。在这些情况下,软件包版本通常不会更新或不准确。
  3. 根据您拥有的软件包 ID 安装每个软件。一次执行一个命令,这样您就可以指定正确的版本。
    • choco install -n 跳过 运行 安装 PowerShell 脚本,因此它实际上只“导入”包进行管理而不执行安装。