Skip to main content
The source remove command removes a configured package source from WinGet. You can also use the rm alias.

Syntax

winget source remove --name <name>

Required Options

-n, --name
string
required
Name of the source to remove

Examples

Remove a custom source:
winget source remove --name Contoso
Use alias:
winget source rm --name MySource

Behavior

The remove command:
  1. Removes the source from WinGet’s configuration
  2. Deletes cached source data
  3. Cannot be undone (except by re-adding the source)

Default Sources

Default sources (winget, msstore) can be removed but this is not recommended. If removed, they can be restored using source reset.
# Not recommended
winget source remove --name winget

# Restore default sources
winget source reset --force

Group Policy Protection

Sources configured via Group Policy cannot be removed:
Error: 0x8A15003D
Source is configured by Group Policy and cannot be removed.

Exit Codes

  • 0 - Success
  • 0x8A150016 - Source not found
  • 0x8A15003D - Source protected by Group Policy
  • 0x80070005 - Access denied (requires administrator)
Removing sources requires administrator privileges.
Removing the default winget source will prevent you from installing packages from the Microsoft community repository.

Build docs developers (and LLMs) love