winget upgrade: How to Update Packages

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.

How to update 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:

ArgumentDescription
-q, --querySpecifies 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:

OptionDescription
-m, --manifestRuns the upgrade from a local YAML file. Provides the path to the file after the option.
--idLimits the upgrade to the application ID.
--nameLimits the search to the application name.
--monikerLimits the search to a particular instance listed for the application.
-v, --versionAllows you to specify an exact version to upgrade to. Not specifying the version means the app upgrades to the most recent version available.
-s, --sourceRestricts the search to the provided source name.
-e, --exactUses the exact case-sensitive string in the query. Does not use the default behavior of a substring.
-i, --interactiveEnables the interactive mode and shows the installer progress.
-h, --silentRuns the installer in silent mode without any UI.
-o, --logCreates a log file and asks for a path to save the file.
-l, --locationPresents the location to upgrade to (if supported).
--forceIgnores any hash mismatches and forces the package installation.
--allUpdates all applications to the latest available version.
--architecture Chooses the architecture to install.
--uninstall-previousUninstalls 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
winget list command prompt output

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
command prompt output for 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
winget upgrade -q command prompt output

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
winget upgrade --id command prompt output

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"
winget upgrade --name command prompt output

Upgrade All Apps

The --all option allows you to upgrade all apps. Run the following:

winget upgrade --all
command prompt output for winget update -all list

The output first shows all applications that can be updated. Next, the command updates them one by one.

winget upgrade --all command prompt output

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
winget upgrade --id Microsoft.Teams.Free --uninstall-previous command prompt output

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.

Was this article helpful?
YesNo
Bosko Marijan
Having worked as an educator and content writer, combined with his lifelong passion for all things high-tech, Bosko strives to simplify intricate concepts and make them user-friendly. That has led him to technical writing at PhoenixNAP, where he continues his mission of spreading knowledge.
Next you should read
APT vs APT-GET: What's the Difference?
June 25, 2020

Learn why the apt command was created, when to use it and how it differs from the apt-get command.
Read more
How to Install and Use Git on Windows
April 18, 2024

This tutorial uses multiple images to show you how to install Git on Windows in a few simple steps, followed by a few basic commands to complete the initial setup.
Read more
How to Install Node.js and NPM on Windows
December 28, 2023

This guide will help you install and update Node.js and NPM on a Windows system.
Read more
How to Generate SSH Key in Windows 10
May 28, 2024

This article explains two methods of generating SSH keys on a Windows 10 system. One method uses the PuTTY tool, while the other uses the OpenSSH client utility.
Read more