microsoft / winget-cli

WinGet is the Windows Package Manager. This project includes a CLI (Command Line Interface), PowerShell modules, and a COM (Component Object Model) API (Application Programming Interface).
https://learn.microsoft.com/windows/package-manager/
MIT License
22.54k stars 1.39k forks source link

Winget does not update #4446

Open massmog opened 1 month ago

massmog commented 1 month ago

Brief description of your issue

Hi,

I am currently have winget installed on my machine and it does not update, when a full package update (aka winget update --all) is executed. Interestingly my winget installation breaks fairly regularly.

Steps to reproduce

Local user:

PS C:\Users\Max> winget update --all
Failed in attempting to update the source: winget
No installed package found matching input criteria.

Super user rights:

PS C:\Windows\System32> winget update --all
No installed package found matching input criteria.

I have tried the following commands to fix the behavior:

winget source reset --force

Furthermore, I have reinstalled winget multiple times and updated the App Installer package to the most recent version.

Expected behavior

Winget installs most recent updates from msstore and winget update database.

Actual behavior

Winget does not update.

Environment

Windows Package Manager v1.7.11132
Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.4355
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.22.11132.0

Winget Directories
-----------------------------------------------------------------------------------------------------------------------
Logs                               %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\Diag…
User Settings                      %LOCALAPPDATA%\Packages\Microsoft.DesktopAppInstaller_8wekyb3d8bbwe\LocalState\sett…
Portable Links Directory (User)    %LOCALAPPDATA%\Microsoft\WinGet\Links
Portable Links Directory (Machine) C:\Program Files\WinGet\Links
Portable Package Root (User)       %LOCALAPPDATA%\Microsoft\WinGet\Packages
Portable Package Root              C:\Program Files\WinGet\Packages
Portable Package Root (x86)        C:\Program Files (x86)\WinGet\Packages
Installer Downloads                %USERPROFILE%\Downloads

Links
---------------------------------------------------------------------------
Privacy Statement   https://aka.ms/winget-privacy
License Agreement   https://aka.ms/winget-license
Third Party Notices https://aka.ms/winget-3rdPartyNotice
Homepage            https://aka.ms/winget
Windows Store Terms https://www.microsoft.com/en-us/storedocs/terms-of-sale

Admin Setting                             State
--------------------------------------------------
LocalManifestFiles                        Disabled
BypassCertificatePinningForMicrosoftStore Disabled
InstallerHashOverride                     Disabled
LocalArchiveMalwareScanOverride           Disabled
github-actions[bot] commented 1 month ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Open similar issues:

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

massmog commented 1 month ago

Comment: https://github.com/microsoft/winget-cli/issues/3525#issuecomment-1736846054 helped

Thanks @HenkPoley

What resolved "Failed in attempting to update the source: winget" for me:

Download this file: https://cdn.winget.microsoft.com/cache/source.msix (e.g. with Edge) Open the Downloads folder Right-click, choose install, follow the wizard to install the package. No clue why this is necessary. Source list remains the same:

PS C:> winget source list Name Argument

msstore https://storeedgefd.dsx.mp.microsoft.com/v9.0 winget https://cdn.winget.microsoft.com/cache Yes, I did run the command mention at the top here: https://github.com/microsoft/winget-cli/issues/3652#issue-1907725867

But I was running a more recent version anyways (1.5? 1.6.??).

A9G-Data-Droid commented 1 month ago

This fix can be automated, and thus winget could be self healing if it performed this action upon seeing that error:

Invoke-WebRequest -Uri https://cdn.winget.microsoft.com/cache/source.msix -OutFile $env:TEMP\source.msix
Add-AppxPackage $env:TEMP\source.msix
massmog commented 4 weeks ago

@A9G-Data-Droid Yeah, Adam, that would be a good feature to have indeed.