Introduction
winget is an open-source Windows package manager that allows users to install, upgrade, remove, and configure applications.
The winget upgrade
command upgrades the user-specified applications to the latest version available in the repository.
In this tutorial, you will learn how to update Windows packages using winget upgrade
.
Prerequisites
- A system running Windows (this tutorial uses Windows 11).
- Windows Package Manager (winget) included in the Windows App Installer installed by default in recent versions of Windows 10 and 11.
- Administrator privileges (depending on the app and its permissions).
winget upgrade Syntax
The syntax for winget upgrade
is:
winget upgrade [argument] [query] [option]
The argument and options are explained in the following sections.
winget upgrade Arguments
The winget upgrade
command has one argument:
Argument | Description |
---|---|
-q , --query | Specifies a query to search for an app. |
winget upgrade Options
The options provide further customization in winget app management. The following table shows the list of commonly used options:
Option | Description |
---|---|
-m , --manifest | Runs the upgrade from a local YAML file. Provides the path to the file after the option. |
--id | Limits the upgrade to the application ID. |
--name | Limits the search to the application name. |
--moniker | Limits the search to a particular instance listed for the application. |
-v , --version | Allows you to specify an exact version to upgrade to. Not specifying the version means the app upgrades to the most recent version available. |
-s , --source | Restricts the search to the provided source name. |
-e , --exact | Uses the exact case-sensitive string in the query. Does not use the default behavior of a substring. |
-i , --interactive | Enables the interactive mode and shows the installer progress. |
-h , --silent | Runs the installer in silent mode without any UI. |
-o , --log | Creates a log file and asks for a path to save the file. |
-l , --location | Presents the location to upgrade to (if supported). |
--force | Ignores any hash mismatches and forces the package installation. |
--all | Updates all applications to the latest available version. |
--architecture | Chooses the architecture to install. |
--uninstall-previous | Uninstalls the previous package version during the upgrade. |
-? ,--help | Shows help about the winget command. |
How to Upgrade Apps
This section explains how to see which app you can upgrade and how to use the upgrade --all
apps option.
List App Updates
To identify which apps have updates available in the repository, run:
winget list
The output lists all installed apps and shows if an update is available.
Alternatively, you can check if a single app has updates using the following syntax:
winget list [keyword]
For example:
winget list vlc
The output shows that VLC has an available update in the repository.
Upgrade a Specific App
The winget argument and options offer several ways to upgrade a specific app.
For example, insert the -q
argument followed by a query word to find and update the specified package to the latest version:
winget upgrade -q Teams
In this example, the upgrade
command upgrades the Microsoft Teams app to the latest available version. Another way is to locate and upgrade an app using its ID. For example:
winget upgrade --id Microsoft.Teams.Free
The command upgrades the Microsoft Teams app to the latest version in the repository using the exact app ID.
You can also use the --name
option to upgrade a specific app. For instance, upgrade the VLC app with:
winget upgrade --name "VlC media player"
Upgrade All Apps
The --all
option allows you to upgrade all apps. Run the following:
winget upgrade --all
The output first shows all applications that can be updated. Next, the command updates them one by one.
upgrade --uninstall-previous Command
The --uninstall-previous
option uninstalls the current version before installing the new one. This ensures a clean installation, preventing issues caused by leftover files or configurations from the old version. It's useful for avoiding potential conflicts during the upgrade process.
For example, uninstall the previous Microsoft Teams version and upgrade to a new one with:
winget upgrade --id Microsoft.Teams.Free --uninstall-previous
Conclusion
This article explained how to use winget
to easily manage your apps and keep them up to date with a single command.
Next, learn how to use other important Windows CMD commands.