-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Broken winget after installing Windows 11 and all its updates #3832
Comments
Hi @lackovic, Could you try |
Why? Everything is working after the 3rd solution I mentioned. |
A fresh install of Windows 11 comes with an earlier version of WinGet. The Microsoft Store will "eventually" update this version to the latest, and once the latest version is present, it should function correctly. Sometimes this happens 15 minutes or so after the install, and other times it may take a bit longer depending on what else needs to be updated via the Microsoft Store on the system. Is there any chance you have logs from those first couple of commands you tried when you didn't get any output? I suspect an upgrade may have been running during or immediately after those, and once the latest version was present, it started working. |
Sorry for not fully reading the Issue. |
Makes sense. That was my assumption as well, that's why when that happened I opened the App Installer in Microsoft Store: I was expecting to see the Update button but when I didn't see it I assumed winget was already up to date and that my fresh installation of Windows 11 was broken.
Sure, here is one of them (which confirms your hypothesis): 2023-10-30 13:01:07.960 [CORE] WinGet, version [1.2.10691], activity [{5B248D77-5D50-486E-A216-07E21F24BDD2}]
2023-10-30 13:01:07.961 [CORE] OS: Windows.Desktop v10.0.22621.2428
2023-10-30 13:01:07.961 [CORE] Command line Args: "C:\Users\marco\AppData\Local\Microsoft\WindowsApps\winget.exe" search telegram
2023-10-30 13:01:07.961 [CORE] Package: Microsoft.DesktopAppInstaller v1.17.10691.0
2023-10-30 13:01:07.961 [CORE] IsCOMCall:0; Caller: winget-cli
2023-10-30 13:01:07.965 [CLI ] WinGet invoked with arguments: 'search' 'telegram'
2023-10-30 13:01:07.965 [CLI ] Found subcommand: search
2023-10-30 13:01:07.965 [CLI ] Leaf command to execute: root:search
2023-10-30 13:01:07.965 [CLI ] Executing command: search
2023-10-30 13:01:07.973 [REPO] GetCurrentSourceRefs: Source named 'microsoft.builtin.desktop.frameworks' from origin Default is hidden and is dropped.
2023-10-30 13:01:07.973 [REPO] Default source requested, multiple sources available, adding all to source references.
2023-10-30 13:01:07.973 [REPO] Adding to source references msstore
2023-10-30 13:01:07.973 [REPO] Adding to source references winget
2023-10-30 13:01:07.974 [REPO] Source past auto update time [5 mins]; it has been at least 28311061 mins
|
Thanks for sharing the log output. We are doing some work in future releases of Windows to reduce the time period for the registration activity, but for now sadly, this is the expected behavior. |
In the mean time, is there some workaround we can use? Maybe some CLI command that updates winget? Having to wait an indeterminate amount of time with no indication of progress is a bit frustrating when setting up a new PC... |
You can use the following PowerShell command
Reference: https://learn.microsoft.com/en-us/windows/package-manager/winget/#install-winget You can also directly install winget with its dependencies through the sandbox script. |
Unfortunately, that PowerShell command doesn't work: A progress bar shortly pops up, the command completes without error, but winget is still "broken". The sandbox script works, though. Thanks! |
After some more testing, on a newly installed Windows 11 23H2, the following Powershell commands suffice to get winget up and running:
|
I get
when doing that on a fresh Windows 11 23H2 install. Edit: Someone below mentioned adding |
Likewise here just a minute ago. None of the potential fixes work on a brand new and freshly updated Win 11 install. Same "prompt turns blue" behavior and same error with the Powershell update process. Winget mostly seems to be hung up trying to interact with the winget source. The source update command worked fine for the store, but hung on the winget source. |
I was able to fix it with these commands. Thank you! |
Running this worked for me:
The thing I changed, is adding the |
This also worked for me! thank you very much. |
Same issue on fresh install of Windows 11 23h2 in Virtual Box. Winget doesnt work and gets empty feedback. |
Good morning, I also confirm that it is not possible to update winget in any way or install the "Microsoft.DesktopAppInstaller_8wekyb3d8bbwe.msixbundle" package in Windows 11 23H2. I hope they solve the problems because I created batch files to install software faster... I think I'll switch to Chocolatey. |
I had this problem yesterday (winget not working due to wrong CDN), here is my description and solution: ChrisTitusTech/winutil#1082 (comment) the TLDR is to install |
<!-- To check a checkbox place an "x" between the brackets. e.g: [x] --> - [x] I have signed the [Contributor License Agreement](https://cla.opensource.microsoft.com/microsoft/winget-pkgs). - [x] This pull request is related to an issue. * #4187 * #3832 * #3706 * #4117 ----- ###### Microsoft Reviewers: [Open in CodeFlow](https://microsoft.github.io/open-pr/?codeflow=https://github.com/microsoft/winget-cli/pull/4188) --------- Co-authored-by: Muhammad Danish <[email protected]>
I additionally needed to change to a directory other than This worked:
|
This issue is still present in the Windows Version 23H2. I have fixed this issue on freshly installed systems by using the winget-install script from PSGallery: Powershell as Administrator:
This can be used if you don't want to touch anything besides powershell for fixing the issue |
So this just happens on any clean install of Win11 now. Would a fix for this be part of a Windows update or? |
I just tried this script to get winget to work on my Win 11 pc. It did not work and gave me these errors. What does this mean please?
Name Version Source Summary nuget 2.8.5.208 https://onege... NuGet provider for the OneGet meta-package manager Then this error happened....(red color) winget-install.ps1 : File C:\Program Files\WindowsPowerShell\Scripts\winget-install.ps1 cannot be loaded because
|
You need to set the execution policy to unresticted for the script For example: powershell as admin |
Thank you for the response. Could you tell me how I go about setting the security policy before I try the script again? I'm not experienced in this sort of thing. |
I think I got it to work now. Winget installed successful as per powershell. |
The script method fixed it for me as well. I think part of my issue was forgetting to set the execution policy ( I am pretty sure I have a GPO that configures that, so I didn't even bother checking until I saw it mentioned in this thread) |
I think this happened to me is because I set my region to Global when installing Windows 11. I did try to use Winget after setting my region back to the US. |
I had the same problem, but the solution above solved it. thank you |
No solutions noted above worked. winget is still unrecognized cmdlet. PowerShell 5 or 7 same results. |
Tried all the solutions above with the same results, winget not a recognized cmdlet. I had it but a recent windows update removed it??
|
this worked for me. crazy how many people it affects and microsoft has no easy fix available. should be standard and part of updates or doable via Microsoft store install |
Brief description of your issue
I have installed Windows 11 on a laptop and completed all the system updates. When I tried to run some winget commands like
winget search
orwinget install
I got an empty output, though the text color of the prompt would turn blue.(1) I tried to update winget from the Microsoft Store but there was no Update button under App Installer.
(2) When I tried to uninstall winget and install it back with the command:
I got the following error:
(3) When I ran:
I got:
and then winget started working.
Steps to reproduce
Install Windows 11 on a computer and install all the updates.
Expected behavior
winget is working.
Actual behavior
winget is not working.
Environment
The text was updated successfully, but these errors were encountered: