Installer cache in %TEMP%\WinGet accumulates silently with no visibility or built-in cleanup

Open
#6,673 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
cpp
Domain
cli

Research direction

Read the related issue #6623 for context on proposed maintenance commands, then trace the installer cleanup flow around RemoveInstallerFile and how WinGet chooses its temporary cache locations. The issue leaves the command design open; done means users can inspect and safely clean leftover installer files in both listed cache locations.

Written by the indexing model from the issue text.

Description

Issue-Feature
Description of the problem

Problem: WinGet leaves downloaded installer files behind in its temp cache with no built-in way to discover or clean them, and they can accumulate to multiple gigabytes over time.

Real-world example

On this machine:

  • %TEMP%\WinGet accumulated a substantial amount of leftover installer payloads over time (e.g. Chrome/GitKraken/GitHubDesktop/Comet installers plus multiple old versions of uv, Devin CLI, Copilot, pi, etc.).
  • The WinGet cache became a noticeable, non-obvious contributor to Temp disk usage.
  • There is no winget command to show the cache size/location or to purge it, so the only recourse was manual deletion: Remove-Item "$env:TEMP\WinGet\*" -Recurse -Force.
Where installers accumulate
  • %TEMP%\WinGet (default temp location)
  • %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\TempState\WinGet (packaged/App Installer context)
Why they are left behind

Winget removes installers after installation via RemoveInstallerFile, but files can remain when an operation is interrupted, fails hash verification in certain flows, or the process exits unexpectedly. These leftovers are not surfaced to the user and are not cleaned up by any winget maintenance command.

Impact
  • Silent disk-space consumption (easy to miss because it lives under Temp).
  • No visibility: users cannot tell from winget how much space its cached installers occupy or where they are.
  • No safe, supported cleanup path exposed by the tool that produced the files.
Notes

Related: #6623 proposes a bundle of maintenance commands (including clean/cache purge/cache list) as a possible solution. This issue is filed to focus on the underlying problem — leftover installer cache is opaque and unmanageable today — independent of any particular command design.

Dominant language
C++
Stars
26.6k
Forks
1.8k
Avg merge
3d 10h
Merged PRs (30d)
41

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/winget-cli

All issues in microsoft/winget-cli

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.