microsoft / microsoft/winget-cli

winget install requires --source even when only one result exists from working sources

Open
#6,164 3 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Command-Install Issue-Bug
Dominant language
C++
Stars
26.4k
Forks
1.8k
Avg merge
1d 11h
Merged PRs (30d)
15

Description

Relevant area(s)

WinGet CLI

Relevant command(s)

winget install

Brief description of your issue

When you have multiple sources configured and one of them is unreachable (e.g. a corporate feed that's offline, or a source that's temporarily down), winget install <package> will fail with something like:

The following packages were found in the working sources.
Please specify one of them using the --source option to continue.

...even if only a single package was found. There's nothing ambiguous about the result: one package, one source, but winget still refuses to proceed and forces you to re-run the command with an explicit --source flag.

This is pretty annoying in practice. If I have a private source that's down and I want to install something from the public winget source, I shouldn't need to know upfront that my other source is broken and manually work around it.

The right behavior should be: if exactly one result comes back from the sources that are working, just use it. The --source prompt makes sense when there are actually multiple ambiguous results to choose from, not when the answer is obvious.

Steps to reproduce

Add a second source that is unreachable (or take one offline temporarily)
Run winget install where the package exists on one of the working sources
Observe the error requiring --source despite there being a single unambiguous result

Expected behavior

When there is only one source available, winget shouldn't ask me to specify the --source flag, this is redundant.

Actual behavior

Winget returns this kind of error:

The following packages were found in the working sources.
Please specify one of them using the --source option to continue.
Environment
Gestionnaire de package Windows v1.9.25200
Copyright (c) Microsoft Corporation. Tous droits réservés.

Windows: Windows.Desktop v10.0.26200.8246
Architecture du système : X64
Package : Microsoft.DesktopAppInstaller v1.24.25200.0

Répertoires Winget
-----------------------------------------------------------------------------------------------------------------------
Journaux                                     %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Paramètres utilisateurs                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\Local…
Répertoire des liens portables (utilisateur) %LOCALAPPDATA%\Microsoft\WinGet\Links
Répertoire des liens portables (ordinateur)  C:\Program Files\WinGet\Links
Racine de package portable (utilisateur)     %LOCALAPPDATA%\Microsoft\WinGet\Packages
Racine du package portable                   C:\Program Files\WinGet\Packages
Racine de package portable (x86)             C:\Program Files (x86)\WinGet\Packages
Téléchargements du programme d’installation  %USERPROFILE%\Downloads

Liens
---------------------------------------------------------------------------------------------
Déclaration de confidentialité        https://aka.ms/winget-privacy
Contrat de licence                    https://aka.ms/winget-license
Avis de tiers                         https://aka.ms/winget-3rdPartyNotice
Page d’accueil                        https://aka.ms/winget
Conditions générales du Windows Store https://www.microsoft.com/en-us/storedocs/terms-of-sale

Paramètre administrateur                  État
---------------------------------------------------
LocalManifestFiles                        Désactivé
BypassCertificatePinningForMicrosoftStore Désactivé
InstallerHashOverride                     Désactivé
LocalArchiveMalwareScanOverride           Désactivé
ProxyCommandLineOptions                   Désactivé
DefaultProxy                              Désactivé

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

Start by reproducing the issue with winget install <package> while one configured source is unreachable, then trace the WinGet CLI install flow that handles results from working sources. Done means a single unambiguous result proceeds without --source, while multiple results still require an explicit source.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.