How to Install winget (Windows Package Manager) (2024)

Introduction

winget is an open-source Windows package manager designed by Microsoft for Windows 10 and Windows 11. The client installs and manages applications using a CLI, similar to the apt package manager in Linux.

In this tutorial, you will learn to install and use the winget package manager for Windows.

How to Install winget (Windows Package Manager) (1)

Prerequisites

  • A computer running Windows 10 or 11.
  • Administrator privileges.
  • A network connection.

How to Install winget

There are two ways to install winget:

  • From the Microsoft Store.
  • Manually, using a package installer from GitHub.

Note: The winget client requires Windows 10 1809 (build 17763) or newer. Windows Server 2019 isn't supported because the Microsoft Store and other dependencies are not available for Windows Server.

If you are already running Windows 10 1809 or newer, the client may already be available on your system. Check if winget is available by invoking the winget command in the Command Prompt or PowerShell:

1. Open the Windows Start menu, type powershell, and press Enter.

How to Install winget (Windows Package Manager) (2)

2. In the PowerShell, run winget to check if the app is installed:

How to Install winget (Windows Package Manager) (3)

In the example above, invoking the command states that winget is not recognized, which means it isn't installed on the system.

Method 1: Install winget via Microsoft Store

Follow the steps below to install winget from the Microsoft Store:

1. Open the Windows Start menu, type store, and press Enter to open the Microsoft Store app.

How to Install winget (Windows Package Manager) (4)

2. In the search bar, type winget and press Enter. In the results, click the App Installer application.

How to Install winget (Windows Package Manager) (5)

Note: The winget client is distributed within the App Installer package.

3. On the App Installerpage, click Get to install the app.

Wait for the installation to finish.

4. Verify the installation by invoking winget in Windows PowerShell or the Command Prompt:

How to Install winget (Windows Package Manager) (7)

The command prints the program version, syntax, and available options.

Method 2: Install winget via GitHub

Another way to install winget is by downloading the installer from GitHub. Follow the steps below:

1. Navigate to the winget GitHub page.

2. Under the Releases section, click the latest available release.

How to Install winget (Windows Package Manager) (8)

3. On the Version page, scroll down to the Assets section and click the .msixbundle file to start the download.

How to Install winget (Windows Package Manager) (9)

4. Run the downloaded file and click Update:

How to Install winget (Windows Package Manager) (10)

Wait for the installation process to finish. The app may automatically install additional dependencies required for winget to work.

5. Verify the installation by running winget in PowerShell or Command Prompt.

How to Use winget

The winget client allows you to search, install, update, and remove packages. This section shows how to manage packages with winget.

The first time you use winget, a prompt appears asking if you agree to Microsoft's transaction terms. This is because the Microsoft Store repository requires your geographic region to function correctly.

Read the terms, and if you agree, type y and press Enter to confirm.

Install Packages

Install a package with winget using the following syntax:

winget install [package_name]

For [package_name], specify the exact application ID. In the following example, we instruct winget to install Notepad++, and winget prompts for the app ID since Notepad++ is available in two repositories.

How to Install winget (Windows Package Manager) (11)

After specifying the exact application ID, winget automatically downloads and installs Notepad++.

Note: Learn how to update installed packages using winget upgrade.

Search for Packages

Use winget to search for available packages in the public Windows Package Manager Community repository or in the Microsoft Store. The syntax is:

winget search [package_name]

In the following example, we search for the MySQL server:

How to Install winget (Windows Package Manager) (13)

The output is a list of all available packages containing the mysql keyword.

Show Package Details

Display information about installed packages using the following command:

winget show [package_name]

For example:

How to Install winget (Windows Package Manager) (14)

The output shows the specified app information, including the program version, publisher, author, and program description.

Manage Sources

winget installs packages from online repositories. The two official winget repositories are:

  • msstore. The Microsoft Store repository.
  • winget. The winget software repository maintained by Microsoft.

Use the winget source command to add, remove, list, or update the repositories.

1. List Repositories

See which repositories winget is using by running:

winget source list
How to Install winget (Windows Package Manager) (15)

The output shows a list of repositories currently in use.

2. Add Repository

Add a third-party repository to winget using the add subcommand. The syntax is:

winget source add --name [name] [url]

For [name], specify the name you want for the repository, and for [url], specify the repository URL.

For example:

How to Install winget (Windows Package Manager) (16)

In this example, we have added the official winget repository.

3. Update Repositories

Force an update to the existing repositories using the update subcommand. Run:

winget source update
How to Install winget (Windows Package Manager) (17)

The command updates the existing repositories with the latest package information.

4. Remove a Repository

Remove a repository from winget using the remove subcommand. The syntax is:

winget source remove --name [name]

For example:

How to Install winget (Windows Package Manager) (18)

The specified repository is automatically removed.

5. Reset winget Sources

Use the reset --force subcommand to reset winget back to its original configuration, removing all third-party repositories and setting the sources to the default ones.

For example:

winget source reset --force
How to Install winget (Windows Package Manager) (19)

List Packages

See a list of all installed packages using the list option. Run:

winget list
How to Install winget (Windows Package Manager) (20)

In the example above, the output includes the list of installed applications, including the application ID, version, and available updates.

Uninstall Packages

Uninstall an application using the uninstall option. The syntax is:

winget uninstall package_name

For example:

How to Install winget (Windows Package Manager) (21)

Conclusion

This tutorial showed how to install and use the winget package manager on Windows. Use winget to automate package management, installation, and configuration, while keeping your apps up to date and system secure.

How to Install winget (Windows Package Manager) (2024)
Top Articles
Latest Posts
Article information

Author: Rubie Ullrich

Last Updated:

Views: 6611

Rating: 4.1 / 5 (72 voted)

Reviews: 87% of readers found this page helpful

Author information

Name: Rubie Ullrich

Birthday: 1998-02-02

Address: 743 Stoltenberg Center, Genovevaville, NJ 59925-3119

Phone: +2202978377583

Job: Administration Engineer

Hobby: Surfing, Sailing, Listening to music, Web surfing, Kitesurfing, Geocaching, Backpacking

Introduction: My name is Rubie Ullrich, I am a enthusiastic, perfect, tender, vivacious, talented, famous, delightful person who loves writing and wants to share my knowledge and understanding with you.