Winget Command: How to Use the Windows Package Manager

In this tutorial, you will learn how to use the Winget package manager to install, update, and remove packages on Microsoft Windows.

Winget is the official command-line tool for managing packages in Windows, similar to package managers like apt or dnf on Linux.

  1. The Winget package manager is installed by default on Windows 11 and the latest version of Windows 10.
  2. You can run the winget command from both CMD and Windows PowerShell.

Let's start by searching for packages. For example, if I want to install PowerShell 7, I can use the winget search command to find the package that installs it.

winget search powershell

This will display a list of packages that match the keyword "powershell." For each package, Winget will display the name, ID, and version.

winget search
winget search

To get more information about a package, use the winget show command. Remember to use the package ID when managing packages.

winget show Microsoft.PowerShell

The winget show command will provide you with detailed information about the specified package, including its name, description, version, publisher, and more.

winget show
winget show

To install packages, we use the winget install command followed by the ID of the package.

winget install Microsoft.PowerShell

To list installed apps on your computer, use the winget list command.

winget list
winget list
winget list

To remove an app, use the winget uninstall command followed by the app's ID. For example, the following command will uninstall PowerShell.

winget uninstall Microsoft.PowerShell

If you type winget upgrade, it will show a list of available updates.

winget upgrade

You can then specify the package ID to upgrade a specific package.

winget upgrade Microsoft.VisualStudioCode
upgrade apps using winget command
upgrade apps using winget command

To view the command options for Winget, simply type winget. This will display the help page, providing you with detailed information about available commands and their usage.

Command Options

searchSearches for available packages
showDisplays detailed information about the specified app
installInstalls a specific app
listLists the installed apps on your Windows PC
uninstallRemoves the specified app
upgradeRun winget upgrade to list available updates. Use winget upgrade <package name> to upgrade a specific package or app