Table of Contents
A new native package manager, WinGet (Windows Package Manager), appeared on Windows 10 and 11. You can use it to install apps from the command prompt (similar to Linux package managers like yum, dnf, apt, etc.).
WinGet.exe is a console tool making app installation easier on a computer running Windows (like Chocolatey package manager). To install a program, you don’t need to search official sites, download the installation files and install apps manually. Using Windows Package Manager, you can install or update any program from the repository with just one command.
How to Install WinGet Package Manager on Windows 10?
You can install WinGet on Windows 10 with build 1709 or newer. Winget is already embedded into the image of the current Windows 11 21H2 and Windows 10 21H1 builds.
If you have recently logged in as a user for the first time and find that winget is not yet available, you can open PowerShell and enter the following command to request this winget registration:
Add-AppxPackage -RegisterByFamilyName -MainPackage Microsoft.DesktopAppInstaller_8wekyb3d8bbwe
To check if winget is installed on your computer, open a PowerShell console and run the command:
PS C:\Users\admin> Get-AppPackage "*Microsoft.DesktopAppInstaller*" | select Name,PackageFullName,Version
Name PackageFullName Version
---- --------------- -------
Microsoft.DesktopAppInstaller Microsoft.DesktopAppInstaller_1.19.10173.0_x64__8wekyb3d8bbwe 1.19.10173.0
In our case, winget is installed (the name of the UWP application is Microsoft.DesktopAppInstaller).
You can install WinGet from the Microsoft Store (it is called App Installer there) https://www.microsoft.com/en-us/p/app-installer/9nblggh4nns1
Also, you can install winget manually using PowerShell (if you removed built-in UWP apps in Windows). To do this, you need to use PowerShell to download the winget msixbundle file from GitHub (https://github.com/microsoft/winget-cli/releases) and install it:
$url = 'https://github.com/microsoft/winget-cli/releases/latest'
$request = [System.Net.WebRequest]::Create($url)
$response = $request.GetResponse()
$tagurl = $response.ResponseUri.OriginalString
$version = $tagurl.split('/')[-1].Trim('v')
$fileName = "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle"
$downloadurl = $tagurl.Replace('tagurl', 'download') + '/' + $fileName
Add-AppxPackage $downloadurl
Check the installed winget version using this command:
PS C:\Users\admin> winget --version
v1.4.10173
Here are the basic winget commands:
- winget install <package> —install a package
- winget uninstall <package> — remove package
- winget upgrade – update software package
- winget list – list installed apps on Windows
- winget show <package> — display the package info
- winget source <options> — manage repositories
- winget search <search_string> — search for packages in repositories
- winget export – export the list of installed programs to a file
- winget import – installation of programs (packages) according to the list in the file
- winget hash <package> — get a package installer hash
- winget validate <package> — to validate a manifest file
Deploying Software Packages in Windows using WinGet
Online repositories are used to install programs via the WinGet package manager. Their list can be displayed with the command:
PS C:\> winget source list
Name Argument
-----------------------------------------------------
msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0
winget https://cdn.winget.microsoft.com/cache
By default, there are two official repositories available in WinGet:
- msstore (https://storeedgefd.dsx.mp.microsoft.com/v9.0) – Microsoft Store repository
- winget (https://winget.azureedge.net/cache) – basic winget software repository maintained by Microsoft
Searching a package
Prior to installing an application via WinGet, you need to find out the package name. To search packages, the search command is used. For example, to search discord app in the repository, run this command:
PS C:\> winget search firefox
Name Id Version Match Source
---------------------------------------------------------------------------------------------------------
Mozilla Firefox 9NZVDKPMR9RD Unknown msstore
Mozilla Firefox Mozilla.Firefox 110.0 Moniker: firefox winget
Mozilla Firefox ESR Mozilla.Firefox.ESR 102.8.0 Command: firefox winget
Mozilla Firefox (Beta) Mozilla.Firefox.Beta 109.0 Command: firefox winget
The command returns the list of packages (with their names and versions) matching your query. Pay attention to the Source column. It lists the repository where the package is located.
You can get information about a specific package:
PS C:\> winget show Mozilla.Firefox
Found Mozilla Firefox [Mozilla.Firefox]
Version: 110.0
Publisher: Mozilla
Publisher Url: https://www.mozilla.org/en-US/
Publisher Support Url: https://support.mozilla.org/en-US/
Author: Mozilla Foundation
Moniker: firefox
Description:
Homepage: https://www.mozilla.org/en-US/firefox/
License: Mozilla Public License Version 2.0
License Url: https://www.mozilla.org/en-US/MPL/2.0
Privacy Url: https://www.mozilla.org/en-US/privacy/websites
Copyright Url: https://www.mozilla.org/en-US/foundation/trademarks/policy
Release Notes:
Installer:
Installer Type: exe
Installer Locale: en-US
Installer Url: https://download-installer.cdn.mozilla.net/pub/firefox/releases/110....
Installer SHA256: 8898c375940bf067afd35fe5017a187f9e0011e1989db4d0a7d584b377e9264d
Release Date: 2023-02-16
Multiple versions of a package can be hosted in the repository. In order to display a list of available package versions, run:
PS C:\> winget show Mozilla.Firefox --versions
Found Mozilla Firefox [Mozilla.Firefox]
Version
-------
110.0
109.0.1
109.0
108.0.2
108.0.1
108.0
Installing a package
For example, you want to install 7zip. Copy its name or ID and run the following installation command:
PS C:\> winget install Mozilla.Firefox
Found Mozilla Firefox [Mozilla.Firefox] Version 110.0
This application is licensed to you by its owner.
Microsoft is not responsible for, nor does it grant any licenses to, third-party packages.
Downloading https://download-installer.cdn.mozilla.net/pub/f...
██████████████████████████████ 55.3 MB / 55.3 MB
Successfully verified installer hash
Starting package install...
Successfully installed
The latest available version of the program is installed by default. You can install a specific version of a package:
winget install Mozilla.Firefox -v 109.0
As you can see, the package manager has automatically downloaded and installed the app using a single command. The program has appeared in the list of installed software in the Windows Start menu.
Then let’s install Windows Terminal and VSCode for my PowerShell scripts.
Search the package names first:
winget search "terminal"
winget search "visual studio"
winget install Microsoft.WindowsTerminal -e ; winget install Microsoft.VisualStudioCode -e
If you want to run the package installation in the background, use the –silent option:
winget install "VLC media player" --silent
When you install some software, you can automatically accept the terms of use. For example, when installing the Sysinternals toolkit:
winget install sysinternals --accept-package-agreements
By default, programs are installed on the system drive in the Program Files folders. You can change the installation folder for a program:
winget install microsoft.visualstudiocode --location "D:\Programs"
Web GUI for WinGet Package Manager
Users who don’t like the winget CLI interface can use the Winstall web service (https://winstall.app/). Winstall is a graphical interface for the WinGet repository (over 4200 programs are available for installation).
You can use Winstall to generate an installation script for the programs you need. Find programs in the repository and click + to add them to the installation script.
Then click on the Generate Script button and the service will create a CLI command to install the selected app packages.
Copy the code from the Batch or PowerShell tab and paste it into cmd.exe or PowerShell console.
Thus, you can install the programs you need with just one command.
Updating and Removing Packages on Windows
WinGet allows you to not only install programs but also update or remove them. To display a list of installed programs on your computer, run:
PS C:\> winget list
Name Id Version Available Source
-----------------------------------------------------------------------------------------------------------------------
Microsoft Edge Microsoft.Edge 100.0.1185.36 110.0.1587.49 winget
Microsoft Edge Update Microsoft Edge Update 1.3.155.85
App Installer Microsoft.DesktopAppInstaller_8wekyb3d8… 1.18.2691.0
Windows Security Microsoft.SecHealthUI_8wekyb3d8bbwe 1000.22621.1.0
Windows Package Manager Source (winget) Microsoft.Winget.Source_8wekyb3d8bbwe 2023.222.1136.279
Mozilla Firefox (x64 en-US) Mozilla.Firefox 109.0 110.0 winget
Mozilla Maintenance Service MozillaMaintenanceService 109.0
Microsoft Visual Studio Code (User) Microsoft.VisualStudioCode 1.75.1 winget
The command will display a complete list of programs installed on the computer (including programs not installed via winget). If an update is available for the program, the new version will be displayed in the Available column.
To update an application installed via winget, run the commands:
winget upgrade --id Mozilla.Firefox
# You can update all installed programs at once:
winget upgrade --all
To remove programs, use the command:
winget uninstall Mozilla.Firefox
You can also uninstall applications not installed via WinGet by their ID:
winget uninstall --id "{0F693AA3-4387-4ACB-A6FD-3A396290587}"
Export and Import Installed Software List to Another Computer
With WinGet, you can export a list of programs installed on a computer to a JSON file and then use this file to quickly install (import) the same set of apps on another computer.
To export the list of installed apps to a JSON file, run:
winget export -o C:\temp\installedapps.json --include-versions
PS C:\> winget export -o C:\temp\installedapps.json --include-versions
Installed package is not available from any source: Microsoft Edge Update
Installed package is not available from any source: App Installer
Installed package is not available from any source: Windows Security
Installed package is not available from any source: Windows Package Manager Source (winget)
Installed package is not available from any source: Mozilla Maintenance Service
The file contains a list of programs installed through the Windows Package Manager.
To install a set of programs from a JSON file on another computer, run the command:
winget import -o "C:\temp\installedapps.json" --include-versions
Windows Package Manager can ignore versions and unavailable programs during installation by adding the –ignore-unavailable and –ignore-versions options.
winget import -o "C:\temp\installedapps.json" --ignore-unavailable --ignore-versions