Summary
- winget ships with Windows 11 — add WindowsApps to PATH if the winget command errors.
- Use winget search/install/list to find apps, install single or multiple (&&), and use –silent to skip prompts.
- Update with winget update (or –all) and uninstall by ID; alternatives include Scoop and Chocolatey.
My favorite thing about Linux might be its command-line package managers. Not a lot of people know this, but five years ago, Microsoft introduced a similar package manager for Windows users which works just like Pacman or APT. It’s called Winget, and this is how you can get started with it.
Make sure winget is working
Winget, like Linux command-line package managers, is bundled with the default installation of Windows 11. You can check if it’s working by opening the terminal and entering the following command.
winget
If it returns an error, you might need to reconfigure an environment variable. Mine didn’t work out of the box, and this is what I did to get winget up and running.
Search for ‘edit the system environment variables’ in Windows search, and open the first result. Under the ‘Advanced’ tab, click ‘Environment Variables.’
You’ll see a list of different variables under your Windows username. Look for the Path variable and click ‘Edit.’
At this point, you can do one of two things. You can open Explorer, navigate to the WindowsApps folder and directly copy the directory path using the Explorer address bar. The folder is located in your Windows directory > Users > Your Username > AppData > Local > Microsoft > WindowsApps. Alternatively, you can replace this dummy path with your exact username (might be case-sensitive) and paste it in the Variable Value field.
C:\Users\YourUsernameGoesHere\AppData\Local\Microsoft\WindowsApps
Click OK three times to close all windows. Close the Terminal if it was already open and try running the same command again.
winget
You should see a list of available options, which means you’re good to go.
How to search for apps with winget
Searching the winget catalog is pretty simple. Just type ‘winget’ and ‘search,’ followed by the term you’re searching for.
The results will show a list of app names with app IDs and version numbers.
Winget also lets you pull up the entire catalog of available apps. If you’re using Command Prompt, try this command
winget search “”
If you’re using Powershell, use the following command instead:
winget search -q `”`”
Finally, you can get the entire list of apps installed on the device like so:
winget list
How to install apps with winget
Installing an app is just as simple. You can either initiate an installation with an app’s name or use the ID (which we surfaced using the search command). For example, you can start an installation with the app ID like this:
winget install Mozilla.Firefox
Alternatively, you can install an app with its moniker. This will load a list of matching app names, and you can copy-paste the target app’s ID to run the installer.
winget install firefox
Then,
winget install Mozilla.Firefox
You should see a loading bar and a ‘Successfully Installed’ message when it’s finished. You can launch the app directly from the terminal by typing the app’s name and pressing Enter.
Sometimes app packages might ask for confirmation before installation. If you don’t want to interact with the installer once you’ve started it, use a ‘silent’ tag with the installer command.
winget install Mozilla.Firefox -- silent
How to update or upgrade packages with winget
You can also update packages with single commands as long as you know the target app’s ID (which you can look up with the search command). For example, to upgrade Firefox to the latest version, you can run this command:
winget update Mozilla.Firefox
If you don’t know which packages need updating, you can run an update command to list every app that has a newer version available. Run this command to list all available updates:
winget update
You can run all available upgrades at the same time using this command:
winget update -- all
How to uninstall apps with winget
Uninstalling apps with winget is straightforward too. All you need is the target app’s ID, which you can find with this command:
winget list
Copy the target app’s ID and run the following command.
winget uninstall Mozilla.Firefox
Sometimes, security or permission-related issues might keep winget from uninstalling an app. If you run into an error like that, you can force an uninstallation by using the — force tag.
winget uninstall Mozilla.Firefox -- force
You can batch install apps by adding more target app IDs in a row. For example,
winget uninstall Mozilla.Firefox Rainmeter.Rainmeter Zoom.Zoom.exe
Running this command will uninstall Firefox, Rainmeter, and Zoom simultaneously. Unlike Linux, however, Windows packages cannot be uninstalled without some user interaction. You might see a setup wizard or a confirmation dialog to remove the app.
It’s shipped by default, but winget isn’t the only command-line package manager that Windows supports. There’s also Scoop and Chocolatey, which I highly recommend.