{"record":{"id":"e8323f22a7da0273","repo":"chocolatey/choco","slug":"installing-all-packages-from-0-is-not-supported","errorCode":null,"errorMessage":"Installing all packages from {0} is not supported.{1}Only internal NuGet repositories are supported.","messagePattern":"Installing all packages from (.+?) is not supported\\.(.+?)Only internal NuGet repositories are supported\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"src/chocolatey/infrastructure.app/services/NugetService.cs","lineNumber":3233,"sourceCode":"\r\n                if (customAction != null)\r\n                {\r\n                    customAction.Invoke();\r\n                }\r\n            }\r\n\r\n            return allPackages;\r\n        }\r\n\r\n        private void SetRemotePackageNamesIfAllSpecified(ChocolateyConfiguration config, Action customAction)\r\n        {\r\n            if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))\r\n            {\r\n                foreach (var repositoryUrl in ApplicationParameters.PublicNuGetSources)\r\n                {\r\n                    if (config.Sources.Contains(repositoryUrl.TrimEnd(('/'))))\r\n                    {\r\n                        throw new ApplicationException(\"Installing all packages from {0} is not supported.{1}Only internal NuGet repositories are supported.\"\r\n                            .FormatWith(repositoryUrl, Environment.NewLine));\r\n                    }\r\n                }\r\n\r\n                var isQuiet = config.QuietOutput;\r\n                config.QuietOutput = true;\r\n                var input = config.Input;\r\n                config.Input = string.Empty;\r\n                var remotePackageList = List(config).Select(p => p.Name).Distinct().ToList();\r\n                config.QuietOutput = isQuiet;\r\n                config.Input = input;\r\n\r\n                config.PackageNames = remotePackageList.Join(ApplicationParameters.PackageNamesSeparator);\r\n\r\n                if (customAction != null)\r\n                {\r\n                    customAction.Invoke();\r\n                }\r","sourceCodeStart":3215,"sourceCodeEnd":3251,"githubUrl":"https://github.com/chocolatey/choco/blob/0d5abdd10cc177a141e69547cad6935b419b6c17/src/chocolatey/infrastructure.app/services/NugetService.cs#L3215-L3251","documentation":"SetRemotePackageNamesIfAllSpecified refuses the 'all' keyword when the configured sources include any public NuGet feed (ApplicationParameters.PublicNuGetSources). Bulk-installing everything from public repos is unsupported; only internal repositories are allowed, so it throws ApplicationException.","triggerScenarios":"Running choco install/upgrade/list with PackageNames equal to ApplicationParameters.AllPackages ('all') while config.Sources contains a public NuGet URL (trimmed of trailing '/') from PublicNuGetSources.","commonSituations":"User passes 'all' while the community/chocolatey public source is still enabled; a script reuses 'all' across a mixed source list including a public feed; CI config mistakenly sets PackageNames=all with default sources.","solutions":["Specify explicit package names instead of 'all'","Scope the command to an internal source only (choco install all --source=<internal-repo>)","Disable public sources for the run before using 'all'","Set up and use an internal NuGet repository as the sole source"],"exampleFix":"// before\nchoco install all\n// after\nchoco install all --source=https://internal-feed/nuget","handlingStrategy":"validation","validationCode":"// Reject 'all' before invoking when any public source is enabled.\nvar publicSources = ApplicationParameters.PublicNuGetSources.Select(s => s.TrimEnd('/'));\nif (config.PackageNames == ApplicationParameters.AllPackages && config.Sources.Split(',').Any(s => publicSources.Contains(s.TrimEnd('/')))) {\n    throw new InvalidOperationException(\"'all' is not allowed with public NuGet sources; specify names or use an internal source.\");\n}","typeGuard":null,"tryCatchPattern":"try { choco.Install(config); }\ncatch (ApplicationException ex) when (ex.Message.Contains(\"Installing all packages\")) {\n    logger.Error(ex.Message); // switch to explicit names or an internal source\n}","preventionTips":["Avoid the 'all' keyword with public/community sources enabled","Scope bulk installs to a single internal feed via --source","Validate PackageNames against the active source list before running"],"tags":["sources","all-packages","install"],"backgroundTag":null,"analyzedSha":"0d5abdd10cc177a141e69547cad6935b419b6c17","analyzedAt":"2026-08-13T18:33:03.301Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}