Skip to content

Uninstallation: No installed package found matching input criteria. (--name/--id behaviour) #3093

Open

Description

Brief description of your issue

Hi
i was trying to update MPC-HC and i discovered that somehow i had 2 versions installed, 1.x and 2.0 (which is the last stable version).

PS C:\_> winget list --name mpc-hc
Name                  Id            Version Available Source
------------------------------------------------------------
MPC-HC 2.0.0 (64-bit) clsid2.mpc-hc 2.0.0             winget
MPC-HC 1.9.24         clsid2.mpc-hc 1.9.24  2.0.0     winget

PS C:\_> winget upgrade
Name                                  Id                       Version    Available  Source
-------------------------------------------------------------------------------------------
Microsoft .NET Core SDK 3.1.302 (x64) Microsoft.DotNet.SDK.3_1 < 3.1.419  3.1.426    winget
Python 3.7.7 (32-bit)                 Python.Python.3.7        3.7.7      3.7.9      winget
MPC-HC 1.9.24                         clsid2.mpc-hc            1.9.24     2.0.0      winget
Dokan Library 1.3.1.1000 Bundle       dokan-dev.Dokany         1.3.1.1000 2.0.6.1000 winget
4 upgrades available.
3 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.

winget reported that the 1.x version had an update available, to the already installed 2.0 version.

So i simply tried to remove the old version but i could not do it in any way.

There seems to be 2 different problems, one with --name, one with --id.
See sections below for details.

I finally found a way by specifying the exact name with quotes:

PS C:\_> winget uninstall "MPC-HC 1.9.24"
Found MPC-HC [clsid2.mpc-hc]
Starting package uninstall...
Successfully uninstalled

Steps to reproduce

have those 2 versions installed then try to remove the old one

Expected behavior

the correct version is found via --id (and possibly --version) or via --name, and removed

Actual behavior

--id

it doesn't work at all, with or without --version:

PS C:\_> winget uninstall --id clsid2.mpc-hc --version 1.9.24
No installed package found matching input criteria.
PS C:\_> winget uninstall --id clsid2.mpc-hc
No installed package found matching input criteria.

--name

winget uninstall --name XXX doesn't work like winget list --name XXX. Why is that?

PS C:\_> winget list --name mpc-hc
Name                  Id            Version Available Source
------------------------------------------------------------
MPC-HC 2.0.0 (64-bit) clsid2.mpc-hc 2.0.0             winget
MPC-HC 1.9.24         clsid2.mpc-hc 1.9.24  2.0.0     winget

PS C:\_> winget uninstall --name mpc-hc
No installed package found matching input criteria.
PS C:\_> winget uninstall mpc-hc --version 1.9.24
No installed package found matching input criteria.
PS C:\_> winget uninstall mpc-hc
No installed package found matching input criteria.
PS C:\_> winget uninstall -q mpc-hc
No installed package found matching input criteria.

Environment

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

Windows: Windows.Desktop v10.0.22621.1413
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.19.10173.0

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

User Settings: %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\settings.json

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

Activity

  1. aetonsi commented on Mar 21, 2023

    @aetonsi
    Author

    ps: i saw the ticket #1886 but --version doesn't seem to be the problem here

  2. Trenly commented on Mar 21, 2023

    @Trenly
    Contributor

    uninstall requires that a single match be found, which is why it is failing on all your attempts. --name mpc-hc still matches both versions, --version is broken, and -q finds the same results as --name mpc-hc.

    Try using the full name - winget uninstall 'MPC-HC 1.9.24'

  3. aetonsi commented on Mar 21, 2023

    @aetonsi
    Author

    Kaleb Luedtke (@Trenly) hi, yes, in the end as i wrote in the first post, i made it work with that exact command.

    But then, if that's the problem, the message No installed package found matching input criteria. is extremely misleading, as the problem is actually the complete opposite of what it says.

    Also, why doesn't winget uninstall --id clsid2.mpc-hc --version 1.9.24 work? i only have 1 app with that id and version.
    Apparently --id has the same problem as --name, and if so, the --version parameter should make the command work, but it doesn't, because apparently it's only applied after --name/--id triggers the problem in question.

    If you or anyone else can confirm that's the case, i'll open 2 different issues (one for the misleading message, one for --version filtering too late) and close this one.

  4. Trenly commented on Mar 21, 2023

    @Trenly
    Contributor

    Also, why doesn't winget uninstall --id clsid2.mpc-hc --version 1.9.24 work? i only have 1 app with that id and version.

    Because of #1886 - The --version switch for uninstall is entirely broken.

  5. added
    Issue-Bug
    and removed
    Needs-Triage
    on Mar 21, 2023
  6. Trenly commented on Mar 21, 2023

    @Trenly
    Contributor

    After looking in more depth, I think this gets back to the fact that SearchForSingle (used by upgrade) has different matching rules than SearchForMany (used by list)

    I added a logging statement into the code to log the number of search results in the EnsureMatchesFromSearchResult and ran both list and upgrade commands. list found 7 results whereas upgrade found 0. This better explains this comment -

    But then, if that's the problem, the message No installed package found matching input criteria. is extremely misleading, as the problem is actually the complete opposite of what it says.

    wingetdev list '.NET Framework'.log
    wingetdev uninstall '.NET Framework'.log

    The message is accurate, as it doesn't actually find the package. Similarly, when searching by the ID, there are also 0 results found. This seems to be due to an issue where multiple strong matches are found, which relates back to the initial implementation of package-version matching. Demitrius Nelon (@denelon) can probably tag this with Area-Matching

    winget dev uninstall Microsoft.WindowsSDK.log

  7. added
    Area-Matching
    on Mar 21, 2023
  8. aetonsi commented on Mar 22, 2023

    @aetonsi
    Author

    Also, why doesn't winget uninstall --id clsid2.mpc-hc --version 1.9.24 work? i only have 1 app with that id and version.

    Because of #1886 - The --version switch for uninstall is entirely broken.

    Oh i see, i didn't think it was applicable to my situation too, as i couldn't uninstall any package, not even an incorrect one.
    I simply thought that applying those 2 filters together, id and version, would work, overcoming the "problem" with the multiple matches for --name/--id returning 0 results.

    wingetdev list '.NET Framework'.log
    wingetdev uninstall '.NET Framework'.log.log

    (just FYI, the 2nd link is broken, it's missing an additional ".log" at the end of the URL)

    I'm going to comment the other issues, you can close here if it's a dupe.

    Thanks

  9. added this to the milestone on Jun 5, 2023
  10. SoundersFan commented on Dec 12, 2023

    @SoundersFan

    Quick fix would be to change the error message to read "Multiple results found when single package query is required." This would cause your customers 😊.

    Additionally, the help text should be
    usage: winget uninstall [[-q] <query-single>...] [<options>]

    as opposed to list --help:
    usage: winget list [[-q] <query>] [<options>]

  11. removed this from the milestone on Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-MatchingIssue-Bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions