winget upgrade - How to Update Packages

Introduction

winget is a client interface for the Windows Package Manager service. The manager 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 10, version 1809 (17763), or later
  • Preview version of Windows App Installer, available on GitHub
  • Administrator privileges

winget upgrade Syntax

The syntax for winget upgrade is:

winget upgrade [argument] [package_name] [option]

The arguments and options are explained in the following sections.

winget upgrade Arguments

The winget upgrade command arguments are:

ArgumentDescription
-q, --querySpecify a query to search for an app.
-?, --helpSee the help notes for the upgrade command.

For example, insert the -q argument followed by a query word to find and update the specified package to the latest version:

Find and upgrade a single app in winget using the -q argument.

In this example, the upgrade command upgrades the Notepad++ app to the latest available version.

Note: If you are a Linux user, check out our article on how to use the apt-get command.

winget upgrade Options

The options provide further customization in winget app management.

The list of options is:

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 that the app upgrades to the highest version available.
-s, --sourceEnter a source name after the -s option to restrict 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, --silentThe installer runs in silent mode without any UI.
-o, --logCreates a log file and asks for a path where to save the file.
--overrideA string that passes directly to the installer.
-l, --locationLocation to upgrade to (if supported).
--forceIgnores any hash mismatches and forces the package installation.
--allUpdates all applications to the latest available version.

For example:

winget upgrade --id VideoLAN.VLC
Upgrade an app in winget using a specific app ID.

The command upgrades the VLC app to the latest version in the repository, using the exact app ID. To see all app IDs, run the list command as explained below.

Note: Check out our Linux commands cheat sheet suitable both for new and advanced Linux users.

List and Upgrade Apps

This section explains how to see which app you can upgrade and how to use the upgrade --all apps option.

List Available Updates

To identify which apps have updates available in the repository, run:

winget list
Checking which apps have updates available in the repository.

The output list all installed apps and winget shows if an update is available.

Alternatively, you can check if a single app has updates with the following syntax:

winget list [keyword]

For example:

Check for updates for a specific app in winget.

The output shows that Notepad++ has an available update in the repository.

Upgrade All Apps

The --all option allows you to upgrade all apps:

winget upgrade --all
Upgrade all apps at once using the winget upgrade command.

However, Microsoft states that winget is still in development, so some features are still a bit buggy. For example, if a developer leaves out the version number in the app, winget states that the app version is unknown and does not update it.

Also, if a developer truncates the program version number but states the full version number in the repository, winget assumes that it is an update and reinstalls the same version.

Note: If you are a Python developer, take a look at our article on installing PIP for Python to easily manage Python packages on Windows.

Conclusion

Now you know how to use winget to easily manage your apps and keep them up to date with a single command.

Feel free to test the tool, even though it is still in the preview phase. Developers keep adding apps to the repository, expanding the app pool, and facilitating app management in Windows.

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
January 8, 2020

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
October 28, 2019

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 5, 2020

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