Dealing With Winget Upgrade Issues
Winget is the built-in Microsoft Windows Package Manager tool that works in both Windows PowerShell and the command prompt. It’s handy for keeping Windows apps and applications up to date. It also works with packages for Microsoft .NET, Desktop, Visual Studio, and C++, plus other Windows 10 or Windows 11 runtime components. Occasionally, the winget upgrade command that checks and updates outdated packages won’t work. This can happen for various reasons, for which various responses will almost always provide a fix or workaround.
In this article, you’ll learn— and see—much of what can go sideways with winget upgrade, and what to do when that happens.
Check Out the Other Winget Articles
This article is the second in a series about the winget package manager. The first in the series, Understand Winget, Microsoft’s Windows Package Manager, is a general overview of the many winget commands you can use. Items in this series address topics such as the following:
- How to resolve multiple instances of the same app or application, some up to date and some not
- Supplemental tools to check and manage Windows updates for which winget manifests (and packages) are not available
- Dealing with “pinned applications” in winget
- Exploring the graphical WingetUI tool as a command-line alternative
A Laundry List of Winget Upgrade Issues
I’ve been running winget upgrade ten-plus Windows 10 and Windows 11 PCs daily for almost a year now. During that time, I’ve seen nearly all the ways that this command can run into trouble and fail to complete or achieve the desired state of leaving only up-to-date apps and applications behind. Here’s a laundry list of the issues I’ve encountered, in no particular order:
- Duplicate entries for an app or application, of which one or more is out of date.
- Winget upgrade fails with “changes to install method” error message.
- Winget upgrade invokes app or application installer, which throws an error message.
- Update fails to complete error message.
- Imprecise targeting for upgrade specification.
- Timeout error when grabbing app and application manifests.
- Bogus app or application version reported (can’t be upgraded, either).
Before I dig into each of these issues, I’d like to start with what has proven itself to be a kind of “ultimate fix” for winget upgrade issues. If I can’t solve such things in 10-15 minutes, I’ll usually resort to this approach rather than spend more time on troubleshooting some specific app or application. I explain this in the next section, and it’s part of the solution for several of the specific cases I discuss after that.
The Ultimate Winget Upgrade Fix: Remove and Replace
When specific upgrade commands don’t work to upgrade a package (using the name, Id, and/or version parameters — see the winget reference at MS Learn for all those details), another approach will likely work. It involves removing the problem package using winget uninstall, and then using winget install to re-install an up-to-date version of that same package. Let’s use PowerShell as an example, using its Id as the focus for the uninstall and (re)install actions.
To remove PowerShell from a PC, find the precise target using the winget list powershell command. This shows an entry with the name PowerShell 7-x64 and Id Microsoft.PowerShell as shown in Figure 1.
To uninstall PowerShell, enter the command winget uninstall Microsoft.PowerShell. This opens the PowerShell installer and a couple subsidiary windows as it gets to work, as shown in Figure 2.
You will have to close the open Windows Terminal session for the uninstall to complete. Then, you’ll run winget install Microsoft.Powershell to (re)install the current version — namely, 126.96.36.199 as I write this, as shown in Figure 3. Notice this removes the OhMyPosh customizations present in the first two figures; they reappear in subsequent screenshots after you close and reopen Windows Terminal. Once again, an installer window opens to handle PowerShell installation. (I skip that in Figure 3.)
Remember this technique if you can’t implement one or more of the approaches I describe in the issue details sections that follow. For the record, Figure 4 shows that PowerShell version 7.3.4 is now running with OhMyPosh once again active. The colorful graphic icons in the command line output show OhMyPosh is working from the C:\Users\Ed folder.
Interestingly, I’ve seen this issue most frequently with PowerShell. Indeed, PowerShell comes in both app and application versions. After installing the app version from the Microsoft Store, you can see two versions in Figure 5: the top one is the app version, named simply “PowerShell” and the bottom one is the application version, named “PowerShell 7-x64.”
This is the most common cause for duplicate entries in winget output. I’ve learned to pick one and uninstall the other for simplicity’s sake. Otherwise, you must keep both instances up to date. Sometimes, one of the instances will show up as outdated. If you have trouble updating it, it may be simplest to uninstall using the Id, which removes both instances. Then install (and stick with) the application version (available directly from PowerShell itself) or the Microsoft Store (usually updates automatically).
Upgrade Fails with Install Method Error
Occasionally, developers will change the installers they bundle with app or applications packages. Winget uses these installers to handle install, uninstall, and upgrade operations. If that installer changes, winget will refuse to update to a newer package version out of an abundance of caution. If you see an error code from a winget upgrade operation that mentions “install method” in its error text, that means something has changed with the installer that winget would ordinarily use to perform an upgrade operation. When this error message appears, use the remove-replace technique described in the “The Ultimate Winget Upgrade Fix: Remove and Replace” section to uninstall the present version, and then to install the current version on your PC.
Upgrade Fails Running Bundled Installer
As part of its typical operation, winget runs the installer that’s bundled with the app or application to handle installs, updates, and uninstalls (removals). If anything goes wrong with the installer, it will pop up an error message above the window in which winget runs. I captured this with an update to VoidTools Everything (version 188.8.131.523) in mid-May 2023, as shown in Figure 6.
The error may or may not cascade into the PowerShell or Command Prompt window. Indeed, winget will occasionally report a successful install when this happens. However, if you run the affected software and check its version number, you will almost certainly see the old version running. And indeed, if you run winget upgrade again for the same app, it will fail again just as shown. There’s nothing one can do about this kind of thing, except wait for the application developer to find and fix the problem. Thus, reporting the error to the developer is a potentially helpful thing to do.
Upgrade Fails to Complete for Running Applications
This is a slight gotcha masquerading as a problem. It occurs most frequently when winget upgrade targets an application that’s already running on your PC. The most common instance is a web browser such as Google Chrome, Mozilla Firefox or Microsoft Edge. I’ve seen it happen for all three on my PC fleet. If one or more of them is running as the upgrades are applied, you must restart them (usually via Help > About, or something similar) before the new version actually takes over for the old. Until that restart occurs, winget will detect the old version running and advise you to upgrade it, even if you’ve upgraded (but not restarted) already. Go figure!
Imprecise Targeting for Upgrade Specification
Occasionally you may get an error from winget upgrade if multiple packages share a common substring and that’s all you specify for the upgrade command (or that’s what a blanket command such as winget upgrade –all implies by default). If you encounter issues with a specific app or application, the best way to attempt an upgrade (update) is to use its Id value in the winget upgrade command rather than all or part of its name. Thus, in the earlier PowerShell example (Figure 5), it’s better to target the –Id Microsoft.Powershell explicitly, rather than the potentially more ambiguous PowerShell. Use winget list powershell to produce (and copy) the exact strings that the command sees and uses for specific applications and apps. Sounds nit-picky, but often works!
Timeout Errors Using Winget Upgrade
Winget has to read its master list of manifests — which drives all knowledge of its “known universe” of available packages — from the servers where that information is stored and maintained. It doesn’t happen very often, but I’ve seen winget experience a timeout error searching its sources when first launching the winget upgrade command. Figure 7 shows what I captured in April 2023 twice in a row when this occurred. If it happens to you, you can’t do anything except wait for those servers to “come around.” In the case depicted, which is the only time this has happened to me, it took a couple hours before the situation was resolved.
Bogus App or Application Version
Sometimes, Microsoft installs things that you may not recognize or even know about. Figure 8 shows a case in point that has popped up out of nowhere on some of my PCs (all of which run Microsoft Teams) from time to time. Apparently, it occasionally uses a software component named “Teams Machine-Wide Installer.” For whatever reason, this component doesn’t upgrade inside winget. I’ve learned to simply uninstall it when it shows up because I haven’t been able to do anything with it otherwise.
Perhaps I’m wrong about this, but I can only understand this Teams element as a kind of “bogus application.” It’s something Windows uses that my PCs apparently neither need nor suffer from the lack of, based on no-impact uninstalls when it shows up. I’ve always got a current backup handy, so I’m perhaps more adventurous than most.
Upgrade Fails for No Good Reason
Sometimes, winget upgrade reports success on an update, but then the same items show up in a follow-up winget upgrade check. I’ve learned that this happens sometimes for no good reasons that I can determine. If it really bothers me, I’ll try the remove-replace technique described at the outset of this article. Most of the time, such things go away on their own in a day or two, in my personal experience. Your mileage may vary, so it’s good to keep remove-replace in mind.
Winget upgrade is a powerful weapon in any Windows admin’s arsenal. It really does help in the battle to stay current and correct where packages (apps, applications, and Windows runtime components) are concerned. If you understand that it might not always work as expected – or fail to upgrade certain items – you will be prepared to deal with such fallout. We should all be glad to have winget upgrade at our disposal, despite the occasional hiccup.