microsoft / microsoft/winget-cli

Uninstall by ID fails with incorrect message when multiple versions are present

Open
#2,476 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Matching Command-Uninstall Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Brief description of your issue

One one of my machines a number of different versions of some apps are installed:

image

image

I thought I would be able to uninstall all versions by ID and then uninstall only the most recent, but uninstalling fails in that case:

image

My analysis is that winget cannot determine which of the installed versions to uninstall, but the message is obviously incorrect.

Uninstalling by name works, albeit with somewhat confusing output:

image

Steps to reproduce

Attempt winget uninstall --id with multiple copies of the same app (with the same ID) are present.

Expected behavior

The operation should fail with a message similar to 'Multiple packages with ID xxx are present'.

Actual behavior

winget uninstall incorrectly states that no installed package matches the specified ID.

Environment
Windows Package Manager v1.3.2091
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19044.1889
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0

Logs: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Contributor guide

Open the contributing guide

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.

Research direction

Start by reproducing the issue with winget uninstall --id when multiple installed versions share the same ID, using the provided environment and checking the diagnostic logs under %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\DiagOutputDir. Done means the command reports that multiple packages with the ID are present instead of claiming no installed package matches.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.