Upgrading your Windows programs with winget
Windows Update keeps Windows itself up to date, but not most of the programs you have installed. winget, the package manager that comes with Windows, can upgrade most of them in one go. This page goes through it step by step, including what to do when something fails.
TL;DR
For readers who know winget and want a recap. New to winget? Start at step 0.
- See what can be upgraded:
winget upgrade -
Optional, only if a program must stay at its version:
winget pin add --id <Id> --exact -
Upgrade the rest:
winget upgrade --all --accept-package-agreements --accept-source-agreements - Stay at the computer and answer the UAC prompts.
-
Run
winget upgradeagain: whatever is still listed didn't upgrade. Retry those one at a time withwinget upgrade --id <Id> --exact - Restart.
Wherever this page shows <Id>, put the program's Id
from step 1 in its place, without the angle brackets.
0. Before you start
- Save your work and close the programs you can, including the ones with an icon by the clock. An installer can't replace a program's files while the program is running, and some installers close the program without asking.
- Open a terminal: right-click the Start button and choose Terminal (on Windows 10, Windows PowerShell). Choose the ordinary one, not the one marked (Admin). Step 4 explains why.
-
Check that winget is there by typing
winget --versionand pressing Enter. If it shows a version number, you're ready. If Windows doesn't recognize the command, install or update App Installer from the Microsoft Store, which is what winget comes with.
1. See what can be upgraded
winget upgrade
The first time, winget may ask you to agree to the terms of the Microsoft Store source. Type Y and press Enter.
You get a list like this one. Yours will show different programs.
Name Id Version Available Source -------------------------------------------------------------------- 7-Zip 26.05 (x64) 7zip.7zip 26.05 26.06 winget Notepad++ (64-bit) Notepad++.Notepad++ 8.9.9 8.9.9.1 winget 2 upgrades available. The following packages have an upgrade available, but require explicit targeting for upgrade: Name Id Version Available Source ------------------------------------------------- Discord Discord.Discord 1.0.9219 1.0.9269 winget 3 package(s) have version numbers that cannot be determined. Use --include-unknown to see all results.
- Id is winget's name for the program. The later steps need it, so copy it exactly: select it with the mouse and press Ctrl+C.
- Version is the version you have, and Available is the newest one.
-
Programs under "require explicit targeting" usually
update themselves, so step 3 leaves them alone. To upgrade one anyway,
name it:
winget upgrade --id <Id> --exact. -
Programs whose version "cannot be determined" are
left out, because winget can't tell which version you have.
winget upgrade --include-unknownlists them, but as winget doesn't know their version, it can't tell whether they need an upgrade either. This page leaves them alone.
2. Optional: keep a program at its current version
This step is optional, and most people can skip it. Read through the list once. Is there a program on it that you know must not change? If nothing comes to mind, go on to step 3. You can come back to this later.
Yes, there is one: how to keep it as it is
Common reasons to keep a version:
- The next major version needs a new paid license, and yours only covers the version you have.
- Plugins, add-ons, mods or project files only work with your version.
- Your work, school or club requires a specific version.
- The new version broke something or dropped a feature you use, and you're waiting for a fix.
Copy the program's Id from the list, and pin it:
winget pin add --id <Id> --exact
There are three kinds of pin:
winget pin add --id <Id> --exact-
winget upgrade --allskips the program. You can still upgrade it by naming it:winget upgrade --id <Id> --exact. winget pin add --id <Id> --exact --blocking- winget won't upgrade the program at all, not even by name, until you remove the pin.
winget pin add --id <Id> --exact --version "4.*"- Upgrades within version 4 are allowed, but not to version 5.
winget pin list shows your pins, and
winget pin remove --id <Id> --exact removes one.
A pin only stops winget. If the program updates itself, also turn off automatic updates in the program's own settings.
Pins are kept, so next time you only need to check whether anything
new on the list needs one. Microsoft's documentation of
the
pin command has the details.
3. Upgrade the rest
winget upgrade --all --accept-package-agreements --accept-source-agreements
-
--allupgrades everything in the main list. If you pinned any programs in step 2, it skips them. -
--accept-package-agreementsaccepts each program's license terms without asking about them one by one. You are still agreeing to them: leave it out if you want to be asked. --accept-source-agreementsdoes the same for the source's terms.
For each program, winget prints something like this:
Found 7-Zip [7zip.7zip] Version 26.06 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://…/7z2606-x64.exe Successfully verified installer hash Starting package install... Successfully installed
The two lines about licenses come with every program and are nothing to worry about. "Successfully verified installer hash" means the download is exactly the file winget expected.
Options left out on purpose:
--include-pinnedwould upgrade the pinned programs too, undoing step 2.-
--forceand--ignore-security-hashskip safety checks, such as the one that a download is the file it should be. Don't use them. --allow-rebootlets installers restart the computer in the middle of the run. Restart yourself at the end instead.
Microsoft's documentation of
the
upgrade command lists all of its options.
4. Stay at the computer and answer the UAC prompts
Many installers need administrator rights, and each one asks for them with its own User Account Control (UAC) prompt: "Do you want to allow this app to make changes to your device?" winget warns you just before, with "The installer will request to run as administrator. Expect a prompt." It waits until you answer, so this isn't something to start and walk away from. It takes a while, too: on the PC this page was checked on, about twenty programs took about a quarter of an hour.
- If nothing seems to happen for a while, a prompt may be waiting where you can't see it. Look for a flashing icon on the taskbar, and click it.
- Check that the prompt names the program winget is installing right now.
- If you answer No, only that program fails, and winget goes on to the next one.
- Some programs close while they're upgraded, and some start up again when they're done.
Why not run the terminal as administrator, to skip the prompts? Some programs refuse to be installed that way. And each prompt is a chance to see what is asking for full control of your computer.
5. Find what failed, and fix it
When winget has finished, list the upgrades again:
winget upgrade
Whatever is still in the main list didn't upgrade. Try those one at a time, so that each one's error is easy to read:
winget upgrade --id <Id> --exact
The most common failures, and what to do about them:
- The program is running
- Installers often fail while their program is open. Close it, including its icon by the clock, and try again.
- The download fails with "Not found (404)"
- The publisher has moved the file, and winget's record of the program still points to the old place. Volunteers and publishers keep these records up to date in the winget-pkgs repository, so try again in a few days, or download the new version from the publisher's website.
- The installer hash doesn't match
-
The download isn't the file winget's record expects, usually because
the publisher replaced it. Try again in a few days. Don't use
--ignore-security-hash: this check is what protects you from a tampered download. - "A newer version was found, but the install technology is different"
-
The new version comes with a different kind of installer, so winget won't install it over the old one.
--allskips these programs, which is why they're still on the list. Uninstall the program and install it again:winget uninstall --id <Id> --exact winget install --id <Id> --exact
Uninstalling may remove the program's settings, so check first if they matter to you. PowerShell 7 (
Microsoft.PowerShell) is a common case: close its windows and do this one from Command Prompt, as you can't uninstall the shell you're typing in.If the uninstall says "No installed package found matching input criteria" although the program is on the list, use its name, exactly as the list shows it:
winget uninstall --name "<Name>" --exact. - "Installer failed with exit code" and a number
-
The program's own installer failed. Restart the computer and try once
more. If it still fails, upgrade the program from its own menu (many
have Check for updates) or from the publisher's website.
Searching for the program's name with the exit code often finds the
cause. A code that starts with
0x8A15is winget's own, and winget's list of return codes explains it. - It asks for a restart
- Restart, then go through this step again.
- It upgraded, but comes back on the list every time
- winget misreads the version of that program. It's harmless. To stop seeing it, pin it.
If a program fails twice in a row, a third try rarely helps. Upgrade what's left from the program itself, or from the publisher's website.
For a closer look at a failure, add --verbose-logs to the
command. --open-logs opens the folder with winget's logs.
Microsoft's
troubleshooting
guide explains what's in them.
6. Restart, and repeat now and then
Restart the computer at the end, as some upgrades only finish then. Do it all again every month or so. If you pinned any programs, the pins are kept, so the next time is quicker.
What winget doesn't cover
- Windows itself and drivers: Windows Update takes care of those.
- Games: Steam, Epic, GOG and other launchers update their own games. winget may upgrade the launcher itself.
- Apps from the Microsoft Store mostly update through the Store, although winget lists some of them too.
-
New major versions of programs that winget keeps as separate
packages, such as Python (
Python.Python.3.10,Python.Python.3.15) and Node.js. winget only upgrades within the one you have, so a new major version has to be installed on its own:winget install --id <Id> --exact. Check first whether something you use needs the old one. - Programs winget doesn't know about.
References
-
Microsoft Learn:
Use WinGet to install and manage applications,
with a page for each command, such as
upgrade,pin,installanduninstall - Microsoft Learn: Debugging and troubleshooting issues with WinGet
- Microsoft Learn: How User Account Control works
- GitHub: winget-cli, winget itself, where problems with winget can be reported, and its return codes
- GitHub: winget-pkgs, the records of the programs winget installs, where a broken download link can be reported
- Microsoft Store: App Installer, which winget comes with