How to Add and Manage Custom Package Sources in Windows Package Manager (winget)

Windows Package Manager (winget) simplifies software discovery, installation, and lifecycle management on Windows 11 and Windows 10. Out of the box, winget queries two primary official repositories: the community-driven winget catalog (backed by Microsoft’s Azure CDN) and the msstore catalog (the Microsoft Store). While these public endpoints satisfy personal computing requirements, enterprise workstations, air-gapped lab systems, and development teams require controlled internal software distributions.

To support corporate governance and private software distribution, Windows Package Manager includes comprehensive source management commands. Administrators can register custom REST repositories, local directory feeds, and network sources to distribute proprietary internal utilities alongside public packages.

Auditing Currently Configured winget Sources

To view all repository sources currently registered on your Windows system, open PowerShell or Windows Terminal as an Administrator and execute:

winget source list

The command outputs a structured table containing three primary attributes:

  • Name: The local identifier assigned to the repository (e.g., winget, msstore).
  • Argument: The underlying endpoint URL or network directory path serving the package manifests.
  • Type: The repository indexing format, typically Microsoft.PreIndexed.Package for Azure CDN indexes or Microsoft.Rest for dynamic API servers.

Adding a Custom Private REST Source

Organizations often host an internal winget REST API server to serve private corporate applications (such as in-house line-of-business tools and configured developer toolchains). To register a private REST package source:

winget source add --name "CorporateRepo" --arg "https://packages.corp.example.com/api" --type "Microsoft.Rest"

If the custom repository requires acceptance of specific terms of service or source agreements, append the --accept-source-agreements parameter to allow automated non-interactive provisioning:

winget source add --name "DevInternal" --arg "https://internal.repo.local/v1" --type "Microsoft.Rest" --accept-source-agreements

Synchronising and Updating Source Catalogs

Windows Package Manager maintains a local SQLite database cache for registered package sources to ensure fast offline searching. To pull the latest package manifests and update catalog indexes across all configured sources:

winget source update

To refresh only a specific repository without triggering a global network sync:

winget source update --name "CorporateRepo"

Searching and Installing Software from a Specific Source

When multiple sources are configured, package IDs or names might overlap. To prevent dependency confusion or accidental installation of external packages when an internal alternative exists, target sources explicitly.

1. Searching within a Dedicated Source

Restrict search queries to a single repository using the --source (or -s) flag:

winget search "InternalUtility" --source "CorporateRepo"

2. Installing from an Explicit Source

Specify the source during installation to enforce provenance:

winget install --id "Corp.InternalUtility" --source "CorporateRepo" --exact

Using the --exact flag ensures winget matches the precise manifest identifier rather than performing a substring lookup.

Exporting and Managing Source Configuration Across Fleets

To inspect comprehensive diagnostic details about active sources, including last update timestamps and cache locations:

winget source export

The exported JSON structure can be reviewed to verify manifest signing requirements and ensure client machines are consuming verified enterprise endpoints.

Removing and Resetting Sources

When a staging server is decommissioned or a test repository is no longer required, remove it cleanly by name:

winget source remove --name "CorporateRepo"

Restoring Default Sources after Corruption

If local source caches become corrupted or network timeouts interrupt catalog updates, reset the source configuration to its original factory state:

winget source reset --force

The --force parameter flushes all cached index files from %LOCALAPPDATA%PackagesMicrosoft.DesktopAppInstaller_8wekyb3d8bbweLocalState, drops non-default sources, and reinstates the official Microsoft community and Store repositories.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.