Skip to main content
Repairs a malfunctioning or corrupted installed package. The repair command provides a unified way to fix applications regardless of installer type.

Usage

winget repair [[-q] <query>] [<options>]

Description

The repair command attempts to fix issues with installed applications such as corrupted files, missing dependencies, or broken registry entries. It uses the native repair capabilities of the installer type (MSI, MSIX, MSStore) or custom repair switches specified in the package manifest.
The package must be installed for repair to work. Use winget list to verify the package is installed.

Arguments

query
string
The query used to search for the package. Can be the package name, ID, or moniker.

Options

Package Selection

--id
string
Filter by the exact package identifier. Use this for precision when multiple packages match.
--name
string
Filter by package name.
--moniker
string
Filter by package moniker.
-v, --version
string
Specify the version to repair. If not specified, repairs the installed version.
--source
string
Limit search to the specified source (e.g., winget, msstore).

Installer Behavior

-m, --manifest
path
Path to a local manifest (YAML) file to use for repair.
--scope
string
Select install scope: user or machine.
-a, --architecture
string
Select the architecture: x86, x64, arm, or arm64.
-i, --interactive
boolean
Run the repair in interactive mode with installer UI.
-h, --silent
boolean
Run the repair in silent mode without user interaction.
--locale
string
Specify the locale to use (e.g., en-US, fr-FR).

Additional Options

-o, --log
path
Path to write the log file.
--force
boolean
Force the repair operation even if there are warnings.
--accept-package-agreements
boolean
Accept all package license agreements automatically.
--accept-source-agreements
boolean
Accept all source license agreements automatically.
--custom-header
string
Optional Windows-Package-Manager REST source HTTP header.

Examples

Repair by Name

winget repair "Visual Studio Code"
Searches for and repairs Visual Studio Code.

Repair by ID

winget repair --id Microsoft.VisualStudioCode
Repairs using the exact package identifier.

Repair Specific Version

winget repair --id Microsoft.PowerShell --version 7.4.0
Repairs a specific version of PowerShell.

Silent Repair

winget repair Git.Git --silent
Repairs Git silently without showing installer UI.

Interactive Repair

winget repair "Microsoft 365" --interactive
Repairs Microsoft 365 with the installer UI for user interaction.

Repair from Manifest

winget repair --manifest .\app-manifest.yaml
Uses a local manifest file to repair the package.

Repair Behavior by Installer Type

The repair process varies depending on the installer type:

Native Repair Support

Uses the built-in MSI repair feature via msiexec with default repair options. Repairs the installation by re-copying files and rewriting registry entries.
Uses the Windows MSIX API to re-register the package, which attempts to repair corrupted or missing files.
Calls the Microsoft Store API (StartProductInstallAsync) with the repair option to fix the application.

Custom Repair Switches

For installer types like Burn, EXE, Nullsoft, and Inno, the manifest must specify:
  • Repair switch: The command-line argument for repair
  • RepairBehavior: How to execute the repair

RepairBehavior Options

BehaviorDescription
ModifyUses the ARP ModifyPath with the repair switch
UninstallerUses the ARP UninstallString with the repair switch
InstallerDownloads the installer and runs it with the repair switch
If the manifest doesn’t specify a repair switch for custom installer types, the repair command will fail with an error.

Exit Codes

CodeMeaning
0Repair completed successfully
-1978335189 (0x8A15000B)Package not found
-1978335169 (0x8A15001F)Package not installed
-1978335215 (0x8A150011)Repair not supported for this installer type

Common Issues

Verify the package is installed using winget list. The package must be present on the system to repair it.
winget list <query>
Some installer types (particularly portable apps) don’t support repair. Check the package manifest or try reinstalling instead:
winget install --id <package-id> --force
Some repairs require administrator privileges. Run your terminal as administrator and try again.

See Also

Build docs developers (and LLMs) love