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
23.34k stars 1.45k forks source link

package search in winget does not work the first time you run it #2673

Open 0xdeadc0d3 opened 2 years ago

0xdeadc0d3 commented 2 years ago

Brief description of your issue

The package search in winget does not work the first time you run it. On the second attempt, it works.

Steps to reproduce

winget search Microsoft.PowerShell

Expected behavior

winget finds 2 packages (second try)

C:\Users\pedri>winget search Microsoft.PowerShell
Name               Id                           Version Source
---------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.2.7.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.3.8.0 winget

Actual behavior

winget finds 0 packages (first try)

C:\Users\pedri>winget search Microsoft.PowerShell
Failed in attempting to update the source: winget
The `msstore` source requires that you view the following agreements before using.
Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction
The source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US").

Do you agree to all the source agreements terms?
[Y] Yes  [N] No: y
Failed when searching source; results will not be included: winget
No package found matching input criteria.

Environment

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

Windows: Windows.Desktop v10.0.22623.875
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2691.0
iDolmatov commented 2 years ago

Failed in attempting to update the source: winget

Failed when searching source; results will not be included: winget

It's probably because of this problem ( #2666 ) that the search is skipped. Please check again after resolving issues with updating catalog data.

denelon commented 2 years ago

@0xdeadc0d3 can you check again?

uhFuzu commented 1 year ago

Just installed winget literally 5 minutes ago on a fresh device and I'm getting the following when I try some of the suggested fixes here:

winget source reset --force Resetting all sources...Done

winget search Microsoft.PowerShell The msstore source requires that you view the following agreements before using. Terms of Transaction: https://aka.ms/microsoft-store-terms-of-transaction The source requires the current machine's 2-letter geographic region to be sent to the backend service to function properly (ex. "US").

Do you agree to all the source agreements terms? [Y] Yes [N] No: Y Failed when searching source; results will not be included: winget No package found matching input criteria.

winget search Microsoft.PowerShell Failed when searching source; results will not be included: winget No package found matching input criteria.