At Microsoft Build 2021, Microsoft announced the release of Windows Package Manager for general use which is Microsoft’s native package manager. In this post, I will try to explain what Windows Package Manager is all about and How winget works, and I will try to be as simple and basic as possible.
What is Windows Package Manager?
In simple terms, Windows Package Manager is the native package manager for Windows to download or update programs from its official source without the need to worry about compatibility and searching all around with a single command. It is an open-source package manager. The majority of IT professionals and even Individuals will get benefits and ease of installations with the feature.
In current scenario, if I have to download a program, normally, I would need to search for the program over to google, find the correct download section and go on about downloading it. Then comes the part where you need to figure out if its the correct version and care about the compatibility of that particular program with your Operating System and Hardware. Some download sites just make it complicated and harder to find the one you need. And if you are not a tech-savvy person, it is likely that you will be doing it over and over to get a right one for you.
This is where Windows Package Manager comes to the rescue. It is like a giant database (technically called repository) of all the programs, and this built-in package manager will let you download the correct program, check if it is the right version, compare it with the existing program in your system and update it if necessary. All of this is done with a single command and you can be assured to get the best one for your system.
How to Download and Install “winget” Windows Package Manager from GitHub?
Windows Package Manager is to be bundled with the upcoming update from Microsoft for Windows 10 with App Installer. If you have an update version 1809 or later, you are bound to get it sooner or later. But if you do not want to wait, you can download Windows Package Manager v1.0 from their GitHub releases. Make sure you download the file with the extension .appxbundle.
To install it, double click on the downloaded file and click on “Update” button.
What is Winget?
Winget is the command-line utility for Windows Package Manager to discover, download, update or remove the programs in your system.
How to use Winget?
You can use command prompt or Windows PowerShell to run winget command. However, I used Windows Terminal for this guide and is recommended by Microsoft.
1. How to Search Programs with winget
Type “winget search <program name>” and hit enter, in the example I search for notepad++, so the command would be “winget search notepad++”
So there is a program with the name “Notepad++” which you can go ahead and install.
2. How to Install Program with winget
To install program with winget, the command is winget install <program name>
So to install Notepad++ type winget install notepad++. Winget command is not case sensitive so do not worry about upper or lower cases.
However if you want to install a specific version of the program, you can do that by typing winget install <program name> -v <version number>. For example, winget install notepad++ -v 7.9.4 will install version 7.9.4 of Notepad++.
3. How to Upgrade or Update with winget
You can either update a single program or all at a same time. the command is winget upgrade <program name> to update that particular program or type winget upgrade –all to update all programs at once (if an update is available).
To check which programs have updates available type winget upgrade. This will list out the programs that can be updated or upgraded.
Note: I went ahead and installed older version of Notepad++.
4. How to Export Program List with winget
This command will export the list of all your program that is available in Windows Program Manager repository. And the list can later be used to import and install programs if you happen to get a new computer or refreshed/reinstalled its Operating System.
The command is winget export -o <file location path> to export the file list to the provided file location.
Example: winget export -o D:\programs.txt will export the list to a file with filename program.txt in D drive.
5. How to Import Program List with winget
Similarly, to import that list, type winget import <file location path> and it will start installing or updating those programs.
6. Uninstall Programs
Type winget uninstall <program name> to uninstall specific program.
winget uninstall notepad++ will uninstall notepad++ from the system.
Summary (winget Cheat Table)
|Search||winget search <program name>||winget search notepad++||Searches for specific program (notepad++)|
|Install||winget install program name||winget install notepad++||Installs program notepad++|
|winget install <program name> -v <version number>||winget install notepad++ -v 7.9.4||Installs notepad++ for specific version 7.9.4|
|Upgrade / Update||winget upgrade||winget upgrade||List of updatable programs|
|Winget upgrade <program name>||winget upgrade notepad++||Upgrades or updates notepad|
|winget upgrade –all||winget upgrade all||Apply updates to all programs.|
|Export program list||winget export -o <file location path>||winget export –o D:\file.txt||Exports file list to file.txt in D:|
|Import program list||winget import <file location path>||winget import D:\file.txt||Import and install listed programs in file.txt|
|Uninstall program||winget uninstall <program name>||winget uninstall notepad++||Uninstalls mentioned program (notepad++)|