winget-cli icon indicating copy to clipboard operation
winget-cli copied to clipboard

Winget import exits early with no error (No packages installed)

Open JonLevin25 opened this issue 2 years ago • 4 comments

Brief description of your issue

winget import winget_buggy_import.json does not install most packages listed. (i.e. Visual Studio installer, or Todoist, the first 2 in the list)

The output shows 6 'not found' packages, and one admin priveleges error. Trying as admin did not help.

Trying a smaller export list (winget_small_import_works.json, containing only the first two packages) Installs them OK.

I've had issues before with import exiting early - #1377, but removing only the VCRedist packages did not help, so this may be something else.

winget_buggy_import.json winget_small_import_works.json

Steps to reproduce

winget import winget_buggy_import.json

Expected behavior

All valid packages should be installed, individual issues should be output as errors to the console

Actual behavior

Most packages are not installed. No descriptive error is output.

> winget import winget_buggy_import.json
No applicable update found.
Package is already installed: Microsoft.EdgeWebView2Runtime
This command requires administrator privileges to execute.
https://github.com/microsoft/winget-cli/issues/2368
Package not found for import: Rufus.Rufus
No applicable update found.
Package is already installed: Google.Chrome
No applicable update found.
Package is already installed: Atlassian.Sourcetree
No applicable update found.
Package is already installed: Microsoft.WindowsPCHealthCheck
No applicable update found.
Package is already installed: Microsoft.VisualStudioCode
> 

Environment

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

Windows: Windows.Desktop v10.0.19044.2006
System Architecture: X64
Package: Microsoft.DesktopAppInstaller v1.18.2091.0

JonLevin25 avatar Oct 03 '22 10:10 JonLevin25

Small note about the github issue form/comments - there used to be a way to upload files directly. I couldn't find it and used pastebin this time. Was the feature removed?

JonLevin25 avatar Oct 03 '22 10:10 JonLevin25

@JonLevin25,

We've made several improvements in WinGet 1.4 related to the install and upgrade flows. Is this problem still happening?

denelon avatar Jan 27 '23 21:01 denelon

I have the same issue as described by @JonLevin25. Fresh install of Windows 11 running on Hyper-V. WinGet version v1.4.10173

JanErikAnkervigTrydal avatar Feb 07 '23 11:02 JanErikAnkervigTrydal

After further debugging, I found that removing "Canonical.Ubuntu" allowed WinGet to complete successfully without early exit.

Steps to reproduce

My winget-export.json looks like this:

{
	"$schema" : "https://aka.ms/winget-packages.schema.2.0.json",
	"CreationDate" : "2023-01-16T08:49:34.174-00:00",
	"Sources" : 
	[
		{
			"Packages" : 
			[
				{
					"PackageIdentifier" : "7zip.7zip"
				},
				{
					"PackageIdentifier" : "Bitvise.SSH.Client"
				},
				{
					"PackageIdentifier" : "Canonical.Ubuntu"
				},
				{
					"PackageIdentifier" : "voidtools.Everything"
				},
				{
					"PackageIdentifier" : "Git.Git"
				},
				{
					"PackageIdentifier" : "Microsoft.Edge"
				},
				{
					"PackageIdentifier" : "Microsoft.EdgeWebView2Runtime"
				},
				{
					"PackageIdentifier" : "Microsoft.WindowsTerminal"
				},
				{
					"PackageIdentifier" : "Notepad++.Notepad++"
				},
				{
					"PackageIdentifier" : "Microsoft.Office"
				},
				{
					"PackageIdentifier" : "Microsoft.OneDrive"
				},
				{
					"PackageIdentifier" : "Postman.Postman"
				},
				{
					"PackageIdentifier" : "Spotify.Spotify"
				},
				{
					"PackageIdentifier" : "Lenovo.SystemUpdate"
				},
				{
					"PackageIdentifier" : "Microsoft.Teams"
				},
				{
					"PackageIdentifier" : "Debian.Debian"
				},
				{
					"PackageIdentifier" : "VideoLAN.VLC"
				},
				{
					"PackageIdentifier" : "WinDirStat.WinDirStat"
				},
				{
					"PackageIdentifier" : "WinMerge.WinMerge"
				},
				{
					"PackageIdentifier" : "WiresharkFoundation.Wireshark"
				},
				{
					"PackageIdentifier" : "Google.Chrome"
				},
				{
					"PackageIdentifier" : "Microsoft.PowerToys"
				},
				{
					"PackageIdentifier" : "OpenJS.NodeJS"
				},
				{
					"PackageIdentifier" : "CodeSector.TeraCopy"
				},
				{
					"PackageIdentifier" : "PuTTY.PuTTY"
				},
				{
					"PackageIdentifier" : "Microsoft.VisualStudioCode"
				},
				{
					"PackageIdentifier" : "Python.Python.3.10"
				},
			],
			"SourceDetails" : 
			{
				"Argument" : "https://cdn.winget.microsoft.com/cache",
				"Identifier" : "Microsoft.Winget.Source_8wekyb3d8bbwe",
				"Name" : "winget",
				"Type" : "Microsoft.PreIndexed.Package"
			}
		}
	],
	"WinGetVersion" : "1.3.2691"
}

Remove item:

{
	"PackageIdentifier" : "Canonical.Ubuntu"
},

Commando:

winget import -i winget-export.json

I hope this helps 😊

JanErikAnkervigTrydal avatar Feb 07 '23 12:02 JanErikAnkervigTrydal

[Policy] Command-Import

Trenly avatar Jun 16 '23 03:06 Trenly