Kiến Thức Linux

winget upgrade – How to Update Packages

How to update packages using winget upgrade?

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:

Argument Description
-q, --query Specify a query to search for an app.
-?, --help See 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:

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 that the app upgrades to the highest version available.
-s, --source Enter a source name after the -s option to restrict 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 The installer runs in silent mode without any UI.
-o, --log Creates a log file and asks for a path where to save the file.
--override A string that passes directly to the installer.
-l, --location 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.

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.

Đăng ký liền tay Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !

Add Comment

Click here to post a comment

Đăng ký liền tay
Nhận Ngay Bài Mới

Subscribe ngay

Cám ơn bạn đã đăng ký !

Lỗi đăng ký !