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
23.3k stars 1.45k forks source link

Winget upgrade or install fails #3826

Open NVT223 opened 1 year ago

NVT223 commented 1 year ago

Brief description of your issue

I can't install any software or upgrade on Winget

Steps to reproduce

winget install 7zip.7zip

Expected behavior

error

Actual behavior

I don'i know

Environment

winget install 7zip.7zip
Failed in attempting to update the source: winget
An unexpected error occurred while executing the command:
InternetOpenUrl() failed.
0x80072efd : unknown error
eabase commented 1 year ago

Can't update and show completely wrong info.

winget search -q "Microsoft.Powershell"
Failed in attempting to update the source: winget
Name               Id                           Version Source
---------------------------------------------------------------
PowerShell         Microsoft.PowerShell         7.3.5.0 winget
PowerShell Preview Microsoft.PowerShell.Preview 7.4.0.4 winget

I don't have 7.3.5 installed, I have 7.3.8 and trying to upgrade to 7.3.9 !!

denelon commented 1 year ago

If you run winget list powershell how many entries do you see?

verrierRoberts commented 1 year ago

I get: winget update --id microsoft.powershell --version 7.3.9.0 --source winget in pwsh at 10:09:34 No available upgrade found. No newer package versions are available from the configured sources. Though starting powershell: A new PowerShell stable release is available: v7.3.9 Upgrade now, or check out the release page at: https://aka.ms/PowerShell-Release?tag=v7.3.9 Que?

eabase commented 1 year ago

If you run winget list powershell how many entries do you see?

2:

Name             Id                        Version     Source
--------------------------------------------------------------
PowerShell 7-x64 Microsoft.PowerShell      7.3.9.0     winget
Windows Terminal Microsoft.WindowsTerminal 1.18.2822.0 winget
denelon commented 1 year ago

@NVT223 which version of WinGet is installed?

Run winget --info and share the results please.

NVT223 commented 1 year ago

winget --info

Here:

PS C:\windows\system32> winget --info Windows Package Manager v1.6.2771 Copyright (c) Microsoft Corporation. All rights reserved.

Windows: Windows.Desktop v10.0.19045.3570 System Architecture: X64 Package: Microsoft.DesktopAppInstaller v1.21.2771.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

denelon commented 1 year ago

You could try changing your default download provider to "wininet" in WinGet settings. The URL at the bottom of the help output will take you to the settings page so you can see how to make the change.

PS C:\Users\denelon> winget settings -?
Windows Package Manager (Preview) v1.7.2782-preview
Copyright (c) Microsoft Corporation. All rights reserved.

Open settings in the default json text editor. If no editor is configured, opens settings in notepad. For available settings see https://aka.ms/winget-settings This command can also be used to set administrator settings by providing the --enable or --disable arguments

usage: winget settings [<command>] [<options>]

The following command aliases are available:
  config

The following sub-commands are available:
  export  Export settings

For more details on a specific command, pass it the help argument. [-?]

The following options are available:
  --enable                  Enables the specific administrator setting
  --disable                 Disables the specific administrator setting
  -?,--help                 Shows help about the selected command
  --wait                    Prompts the user to press any key before exiting
  --logs,--open-logs        Open the default logs location
  --verbose,--verbose-logs  Enables verbose logging for winget
  --disable-interactivity   Disable interactive prompts

More help can be found at: https://aka.ms/winget-settings
NVT223 commented 12 months ago

choco upgrade epicgameslauncher Chocolatey v2.2.2 Upgrading the following packages: epicgameslauncher By upgrading, you accept licenses for the packages. epicgameslauncher is not installed. Installing... Unable to load the service index for source https://community.chocolatey.org/api/v2/. The request was aborted: Could not create SSL/TLS secure channel. For more information on this issue and guidance in resolving the problem, see https://ch0.co/t/svcidx Unable to connect to source 'https://community.chocolatey.org/api/v2/': Object reference not set to an instance of an object. epicgameslauncher not installed. The package was not found with the source(s) listed. Source(s): 'https://community.chocolatey.org/api/v2/' NOTE: When you specify explicit sources, it overrides default sources. If the package version is a prerelease and you didn't specify --pre, the package may not be found. Please see https://docs.chocolatey.org/en-us/troubleshooting for more assistance.

Chocolatey upgraded 0/1 packages. 1 packages failed. See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures

Did you know the proceeds of Pro (and some proceeds from other licensed editions) go into bettering the community infrastructure? Your support ensures an active community, keeps Chocolatey tip-top, plus it nets you some awesome features! https://chocolatey.org/compare

Plz help!!!

Masamune3210 commented 12 months ago

@NVT223 winget has nothing to do with chocolatey.....

Trenly commented 8 months ago

@nvt223 - - Are you still experiencing this issue with the latest release of the cli?

huyz commented 8 months ago

@Trenly I'm not OP but I'm still getting the issue with the latest release v1.7.10661 of the CLI:

 huyz  winget --version
v1.7.10661

 huyz  winget source update winget
Updating source: winget...
Cancelled

 huyz  winget update
Failed in attempting to update the source: winget
Name                                                      Id                           Version       Available     Source
-------------------------------------------------------------------------------------------------------------------------
Microsoft Edge                                            Microsoft.Edge               122.0.2365.80 122.0.2365.92 winget
WinSCP 6.3.1                                              WinSCP.WinSCP                6.3.1         6.3.2         winget
Microsoft Visual C++ 2015-2022 Redistributable (x86) - 1… Microsoft.VCRedist.2015+.x86 14.38.33135.0 14.40.33617.1 winget
Microsoft Visual Studio Code (User)                       Microsoft.VisualStudioCode   1.87.1        1.87.2        winget
Microsoft Visual C++ 2015-2022 Redistributable (x64) - 1… Microsoft.VCRedist.2015+.x86 14.38.33135.0 14.40.33617.1 winget
5 upgrades available.

 huyz  winget install WinSCP.WinSCP
Found an existing package already installed. Trying to upgrade the installed package...
An unexpected error occurred while executing the command:
InternetOpenUrl() failed.
0x80072f7d : unknown error

But when I open a VPN connection to another country:

 huyz  winget source update winget
Updating source: winget...
Done

 huyz  winget update
Name                                                      Id                           Version       Available     Source
-------------------------------------------------------------------------------------------------------------------------
Microsoft Edge                                            Microsoft.Edge               122.0.2365.80 122.0.2365.92 winget
WinSCP 6.3.1                                              WinSCP.WinSCP                6.3.1         6.3.2         winget
Microsoft Visual C++ 2015-2022 Redistributable (x86) - 1… Microsoft.VCRedist.2015+.x86 14.38.33135.0 14.40.33617.1 winget
Microsoft Visual Studio Code (User)                       Microsoft.VisualStudioCode   1.87.1        1.87.2        winget
Microsoft Visual C++ 2015-2022 Redistributable (x64) - 1… Microsoft.VCRedist.2015+.x86 14.38.33135.0 14.40.33617.1 winget
5 upgrades available.

 huyz  winget install WinSCP.WinSCP
Found an existing package already installed. Trying to upgrade the installed package...
Found WinSCP [WinSCP.WinSCP] Version 6.3.2
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://sourceforge.net/projects/winscp/files/WinSCP/6.3.2/WinSCP-6.3.2-Setup.exe/download
  ██████████████████████████████  11.0 MB / 11.0 MB
Successfully verified installer hash
Starting package install...
Successfully installed

Is something wrong with the Microsoft servers around the world?

5l2 commented 5 months ago

Check that TLS 1.2 and TLS 1.3 are enabled if you're experiencing this issue.

Location: > Internet Properties > Advanced > Use TLS 1.x

jacattrongnlh commented 2 months ago

I've tried a lot of options. Only this solved it: my computer has a VPN program installed. winget can't update anything, then I start the VPN, now winget work without error.

huyz commented 2 months ago

@jaccattrongnlh Sounds like you're in VN. If so, switch your connection from VNPT to FPT (or maybe Viettel)

huyxdong commented 6 days ago

@jaccattrongnlh Sounds like you're in VN. If so, switch your connection from VNPT to FPT (or maybe Viettel)

You're genius, I'm from VN too. It's worked with VPN connected to my office. Doesn't know why. I'm using Viettel at home, VNPT at office.