microsoft / microsoft/winget-cli

Commands referencing packages that share an Id often throw the error message "No installed package found matching input criteria"

Open
#3,750 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Area-Matching 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

When upgrading programs that share an Id (ex: PostgreSQL.PostgreSQL and Microsoft.DotNet.SDK.6), the upgrade fails with an error message of No installed package found matching input criteria. Other commands such as uninstall can also fail when referencing packages by name. Them sharing an Id is an observation on my end for the packages that continually fail to perform winget actions, but this could be a larger issue or package specific issues.

Steps to reproduce

Install PostgreSQL 11 and PostgreSQL 15. Run winget upgrade to view that there are two entries for postgresql updates that both point to the latest version (16 at the time of writing this).

Expected behavior

I would expect that if I reference one of the available postgresql versions by their names during a command (ex: winget upgrade --name "PostgreSQL 11), that it would install PostgreSQL 16 and that the "available" upgrades for PostgreSQL 11 and PostgreSQL 15 would not appear anymore. I would also expect that winget upgrade --id "PostgreSQL.PostgreSQL", winget upgrade --name "PostgreSQL 11", and winget upgrade --name "PostgreSQL 15" would all succeed regardless of which one I ran whether I reference them by name or Id.

Actual behavior

References to the Id work for upgrades but references to the package name only sometimes work. Also, after upgrading to PostgreSQL 16, winget upgrade still shows the other postgresql versions as having an "available" upgrade but fail to "upgrade" when I try again. I'll list the steps for testing that I went through to verify that below:

I started with only versions 11 and 15 of PostgreSQL installed.

Listing available upgrades:

> winget upgrade
Name                                                               Id                           Version       Available     Source
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11                                                      PostgreSQL.PostgreSQL        11            16.0          winget
PostgreSQL 15                                                      PostgreSQL.PostgreSQL        15            16.0          winget

Trying to update PostgreSQL 11 specifically by name (fails):

> winget upgrade --name "PostgreSQL 11"
No installed package found matching input criteria.

Trying to update PostgreSQL 15 specifically by name (succeeds):

> winget upgrade --name "PostgreSQL 15"
Found PostgreSQL 16 [PostgreSQL.PostgreSQL] Version 16.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Successfully verified installer hash
Starting package install...
Successfully installed

Note: I uninstalled PostgreSQL 16 before the next step but I had to do it through the windows GUI under Add or remove programs since if I tried to do it via winget with the command winget uninstall --name "PostgreSQL 16", it failed with the error No installed package found matching input criteria..

Trying to update postgresql via the Id PostgreSQL.PostgreSQL (succeeds):

> winget upgrade --id "PostgreSQL.PostgreSQL"
Found PostgreSQL 16 [PostgreSQL.PostgreSQL] Version 16.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://get.enterprisedb.com/postgresql/postgresql-16.0-1-windows-x64.exe
  ██████████████████████████████   391 MB /  391 MB
Successfully verified installer hash
Starting package install...
Successfully installed

Even though PostgreSQL 16 is installed now, winget upgrade still lists the previous PostgreSQL versions as needing an upgrade. If I run any of the upgrade commands above again, they all display the error No installed package found matching input criteria.

> winget upgrade
Name                                                               Id                           Version       Available     Source
----------------------------------------------------------------------------------------------------------------------------------
PostgreSQL 11                                                      PostgreSQL.PostgreSQL        11            16.0          winget
PostgreSQL 15                                                      PostgreSQL.PostgreSQL        15            16.0          winget
>
> winget upgrade --name "PostgreSQL 11"
No installed package found matching input criteria.
>
> winget upgrade --name "PostgreSQL 15"
No installed package found matching input criteria.
>
> winget upgrade --id "PostgreSQL.PostgreSQL"
No installed package found matching input criteria.
Environment
`Windows Package Manager v1.6.2771`
`Windows: Windows.Desktop v10.0.22621.2283`
`Package: Microsoft.DesktopAppInstaller v1.21.2771.0`

**Note:** This is the output from `winget --info` but I do have Windows 11, not 10 so I'm not sure why it shows 10 as my desktop version.

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

Reproduce the issue with the listed winget upgrade and uninstall commands using packages that share the PostgreSQL.PostgreSQL Id. Trace the package selection behavior for --name and --id, then verify that upgrading or uninstalling one installed version no longer leaves invalid upgrade entries or reports no matching package.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 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.