Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uninstall fails when two versions have the same name, and different ID. #1619

Closed
denelon opened this issue Oct 21, 2021 · 4 comments
Closed
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Side-by-Side Issue related to side by side package installation
Milestone

Comments

@denelon
Copy link
Contributor

denelon commented Oct 21, 2021

@denelon I'm experiencing this issue when trying to uninstall a package.

> winget list --name Colorpicker
Name        Id                  Version Available Source
--------------------------------------------------------
Colorpicker Toinane.Colorpicker 2.0.0   2.0.3     winget
Colorpicker Toinane.Colorpicker 2.0.3             winget

One of those packages (the new one) was installed via an .exe downloaded from the internet, the other one was installed via winget (at least that's how I remember it, don't count on it though).

So I wanted to remove one of the packages:

> winget uninstall Colorpicker
Multiple installed packages found matching input criteria. Please refine the input.
Name              Id
--------------------------------------------------------
Colorpicker       Toinane.Colorpicker
Colorpicker 2.0.3 {2fa01720-ea93-5692-9697-66fad2caf3bf}

I totally understand why the command would fail, so I found out about the "exact" flag and tried that:

winget uninstall -e Toinane.Colorpicker
Multiple installed packages found matching input criteria. Please refine the input.
Name              Id
--------------------------------------------------------
Colorpicker       Toinane.Colorpicker
Colorpicker 2.0.3 {2fa01720-ea93-5692-9697-66fad2caf3bf}

The ids are clearly not the same, why is this failing? I'm also confused as to why the winget list also returns two packages, but both have the same id.

I also reported the issue here: #282 (comment), but I assume it's the wrong issue as that is specifically about installing powershell.

In case you are wondering about the version:

> winget -v
v1.1.12663

Originally posted by @Elias-Graf in #1083 (comment)

@ghost ghost added the Needs-Triage Issue need to be triaged label Oct 21, 2021
@denelon denelon added Issue-Bug It either shouldn't be doing this or needs an investigation. and removed Needs-Triage Issue need to be triaged labels Oct 21, 2021
@denelon denelon added this to the v1.2-Client milestone Oct 21, 2021
@Infineight
Copy link

winget -v
v1.1.12663

I have also run into this issue. Caused for me by having the package installed at the machine level via executable installer, then upgrading the package with winget, which defaulted to installing the new package at the user level. I would have expected winget to check what level the package was installed at and match that when doing the upgrade.

Uninstall Failure

I tried using the -e, --id and --name flags for the uninstall of the older package, but none of them worked.

Workaround

The workaround for the issue was to go to Apps and Features in Windows and uninstall the older version there.

Possible UI improvement

It might be a good idea to show in a separate column in the output how the package was installed, at the machine or user level. Then at least it would be more immediately obvious to the user where the problem lies before doing a web search about the issue.

This column would also be good to have with winget list from a security point of view in case the user accidentally installed a package at the machine level in error.

@DrPepperBianco
Copy link

I have a similar (probably the same) problem.

winget upgrade shows me an upgdare for Microsoft .NET SDK, When I call winget upgrade "Microsoft .NET SDK" I see the following result:

PS C:\Windows\system32> winget upgrade -q "Microsoft .NET SDK"
Multiple installed packages found matching input criteria. Please refine the input.
Name                             Id
-----------------------------------------------------------------------
Microsoft .NET SDK               Microsoft.dotnet
Microsoft .NET SDK 5.0.403 (x64) {81aba691-7919-4e81-9d4a-e5df954b0b1d}
Microsoft .NET SDK 5.0.303 (x64) {b447173e-28f0-40ae-b0c8-15b9c0a1ad4b}
PS C:\Windows\system32>

So, I call it again with winget upgrade -e "Microsoft .NET SDK" but get the same result. Although all 3 installations have different names and also different ids. The test with --id also didn't work, with or without -e.

@DrPepperBianco
Copy link

Oh, by the way, if you have already the newest version of dotnet installed (or any other program of course) and also a specific version, winget should not show the specific version as being able to be upgraded. It would probably be useful to hide certain installation from upgrade completely. Just a thought.

@denelon
Copy link
Contributor Author

denelon commented Apr 2, 2024

We've been working on the side-by-side scenarios. You could try the latest release and enable the experimental feature on:

Please provide feedback at:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Bug It either shouldn't be doing this or needs an investigation. Side-by-Side Issue related to side by side package installation
Projects
None yet
Development

No branches or pull requests

3 participants