Search code examples
chocolatey

How does Chocolatey know which packages are installed locally?


How does Chocolatey determine which packages are installed on the local system?

Somehow choco list -localonly lists packages installed locally and invokes nuget.exe in the process. In NuGet I know packages.config lists installed packages, but in Chocolatey I don't seem to find a similar file.


Solution

  • choco list -lo only lists the latest versions of the packages you have installed.

    Old choco invoked nuget.exe, new choco (0.9.9+) does it directly since it has nuget.core built-in.

    It does a list against %ChocolateyInstall%\lib when you call list -lo. If several versions of the same package exist, only the latest version will be listed. Use list -lo -a to show all versions of the same package available locally.

    Further, it is not based on folders, but on the actual nupkg files in those folders.

    If you want a list of programs and features, add -i as an option. See choco list -h or the docs page for details.