microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.5k stars 1.39k forks source link

Getting a massive amount of packages whose version cannot be determined after using 'winget upgrade' #4510

Open AvogatoWizardWhisker opened 1 month ago

AvogatoWizardWhisker commented 1 month ago

Brief description of your issue

I ran winget upgrade to update available packages. When it was done, i got the following text

86 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.

But when run winget upgrade --include-unknown, there was only one package whose version is unknown

image

Steps to reproduce

  1. Run winget upgrade --all -h
  2. Waiting for available packages to update
  3. After finishing the update, I get the message 86 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.

Expected behavior

I'm expecting for packages to successfully update.

Actual behavior

When winget finished updating packages, this message shows up 86 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results. Even tho i run winget upgrade --include-unknown, there's only one package (NirSoft.BlueScreenView) with unknown version.

Environment

Windows Package Manager v1.7.11261
Windows: Windows.Desktop v10.0.26217.5000
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.11261.0
github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

AvogatoWizardWhisker commented 1 month ago

I double checked with winget upgrade --include-unknown, there was only one package

image

Trenly commented 1 month ago

@florelis accurately described the issue in #2458

I took a quick look at the code and saw two possible sources for inconsistencies with the unknown count

  1. When listing available upgrades we first filter the unknown installed versions and count them there, but we may later remove other packages that are not available from any source. So the count of unknown includes those un-available packages that are not listed with --include-unknown. That's probably what happened here.
  2. When performing the upgrades we first filter the unknown versions and count them there, but we later remove packages where the update is not applicable (e.g., mismatched architecture). So the count of unknown includes the non-applicable updates that are not applied with --include-unknown.