Back to Winget Cli

upgrade Command

doc/windows/package-manager/winget/upgrade.md

1.28.2407.4 KB
Original Source

upgrade command (winget)

The upgrade command of the winget tool upgrades the specified application. Optionally, you may not specify an application, this will list all available upgrades instead.

The upgrade command requires that you specify the exact string to upgrade. If there is any ambiguity, you will be prompted to further filter the upgrade command to an exact application.

Usage

winget upgrade [[-q] <query>...] [<options>]

The following command aliases are available:
update

Options

The options allow you to customize the upgrade experience to meet your needs.

OptionDescription
-m, --manifestMust be followed by the path to the manifest (YAML) file. You can use the manifest to run the upgrade experience from a local YAML file.
--idLimits the upgrade to the ID of the application.
--nameLimits the search to the name of the application.
--monikerLimits the search to the moniker listed for the application.
-v, --versionEnables you to specify an exact version to upgrade. If not specified, the latest will upgrade the highest versioned application.
-s, --sourceRestricts the search to the source name provided. Must be followed by the source name.
-e, --exactUses the exact string in the query, including checking for case-sensitivity. It will not use the default behavior of a substring.
-i, --interactiveRuns the installer in interactive mode. The default experience shows installer progress.
-h, --silentRuns the installer in silent mode. This suppresses all UI. The default experience shows installer progress.
-o, --logDirects the logging to a log file. You must provide a path to a file that you have the write rights to.
--overrideA string that will be passed directly to the installer.
-l, --locationLocation to upgrade to (if supported).
--forceWhen a hash mismatch is discovered will ignore the error and attempt to install the package.
--allUpdates all available packages to the latest application.
--include-unknownAttempt to upgrade a package even if the package's current version is unknown.
--purgeDeletes all files and directories in the package directory (portable).
--customArguments to be passed on to the installer in addition to the defaults.
--scopeSelect installed package scope filter (user or machine).
-a, --architectureSelect the architecture to install.
--localeLocale to use (BCP47 format).
--ignore-security-hashIgnore the installer hash check failure.
--ignore-local-archive-malware-scanIgnore the malware scan performed as part of installing an archive-type package from a local manifest.
--accept-package-agreementsAccept all license agreements for packages.
--accept-source-agreementsAccept all source agreements during source operations.
--headerOptional Windows-Package-Manager REST source HTTP header.
-r, --recurse, --allUpgrade all installed packages to the latest version if available.
--pinned,--include-pinnedUpgrade packages even if they have a non-blocking pin.
--uninstall-previousUninstall the previous version of the package during the upgrade.
--waitPrompts the user to press any key before exiting.
--logs,--open-logsOpen the default logs location.
--verbose,--verbose-logsEnable verbose logging for winget.
--disable-interactivityDisable interactive prompts.
--installer-typeSelect the installer type
--skip-dependenciesSkips processing package dependencies and Windows features

Example queries

The following example upgrades a specific version of an application.

CMD
winget upgrade powertoys --version 0.15.2

The following example upgrades an application from its ID.

CMD
winget upgrade --id Microsoft.PowerToys

The following example shows upgrading all apps

CMD
winget upgrade --all

Using list and upgrade

It is common to use the list command to identify apps in need of an update, and then to use upgrade to install the latest.

In the example below you will see list identifies that an update is available for JetBrains.Toolbox, and then the user uses upgrade to update the application.

upgrade --all

upgrade --all will identify all the applications with upgrades available. When you run winget upgrade --all the Windows Package Manager will look for all applications that have updates available and attempt to install the upgrade.