chocolatey/choco · error · NotImplementedException

This source is not supported on non-Windows systems

Error message

This source is not supported on non-Windows systems

What it means

Thrown as a NotImplementedException in CygwinService.EnsureSourceAppInstalled when Platform.GetPlatform() does not return PlatformType.Windows. The Cygwin source type relies on Windows-specific executables and APIs (the Cygwin setup.exe) that do not exist on Linux or macOS, making the entire source non-functional on non-Windows platforms.

Source

Thrown at src/chocolatey/infrastructure.app/services/CygwinService.cs:146

            args.Add("_package_name_", new ExternalCommandArgument
            {
                ArgumentOption = "--packages ",
                ArgumentValue = PackageNameToken,
                QuoteValue = false,
                Required = true
            });
        }

        public string SourceType
        {
            get { return SourceTypes.Cygwin; }
        }

        public void EnsureSourceAppInstalled(ChocolateyConfiguration config, Action<PackageResult, ChocolateyConfiguration> ensureAction)
        {
            if (Platform.GetPlatform() != PlatformType.Windows)
            {
                throw new NotImplementedException("This source is not supported on non-Windows systems");
            }

            var runnerConfig = new ChocolateyConfiguration
            {
                Sources = ApplicationParameters.PackagesLocation,
                Debug = config.Debug,
                Force = config.Force,
                Verbose = config.Verbose,
                CommandExecutionTimeoutSeconds = config.CommandExecutionTimeoutSeconds,
                CacheLocation = config.CacheLocation,
                RegularOutput = config.RegularOutput,
                PromptForConfirmation = false,
                AcceptLicense = true,
                QuietOutput = true,
            };
            runnerConfig.ListCommand.LocalOnly = true;

            var localPackages = _nugetService.List(runnerConfig);

View on GitHub (pinned to 0d5abdd10c)

Solutions

  1. Run Chocolatey with Cygwin sources only on Windows hosts.
  2. Use the 'normal' source type or a platform-appropriate alternative source on non-Windows systems.
  3. In CI/CD, ensure Windows-based runners are used for any Cygwin source operations.
  4. Remove or disable Cygwin sources in config when targeting cross-platform execution.

Example fix

// before: attempting Cygwin on non-Windows
choco install bash --source-type=cygwin  # on Linux/macOS

// after: run on Windows, or use a different source type
// On Windows:
choco install bash --source-type=cygwin
// On Linux: use the system package manager (apt, dnf) instead
Defensive patterns

Strategy: validation

Validate before calling

// Before any Cygwin source operation, verify the platform
if (config.SourceType.IsEqualTo(SourceTypes.Cygwin) && Platform.GetPlatform() != PlatformType.Windows)
{
    throw new PlatformNotSupportedException(
        "Cygwin source type is only supported on Windows. Use 'normal' source type on this platform.");
}

Type guard

public static bool IsCygwinSupportedOnCurrentPlatform()
{
    return Platform.GetPlatform() == PlatformType.Windows;
}

Try / catch

try
{
    _cygwinService.EnsureSourceAppInstalled(config, action);
}
catch (NotImplementedException ex) when (ex.Message.Contains("not supported on non-Windows"))
{
    logger.Error("Cygwin source requires Windows. Switch to a compatible source type for this platform.");
}

Prevention

When it happens

Trigger: Any Cygwin source operation (install, list, search) triggers EnsureSourceAppInstalled as part of the bootstrappable source runner check. If Chocolatey is running on Linux or macOS and config.SourceType is 'cygwin', this exception is thrown before any Cygwin command executes.

Common situations: Running Chocolatey on WSL, Linux containers, or macOS with a Cygwin source configured. Also occurs in CI/CD pipelines that use Linux runners but have Cygwin source references in configuration. Cygwin is inherently a Windows-only compatibility layer.

Related errors


AI-assisted analysis of chocolatey/choco@0d5abdd10c (2026-08-13). Data as JSON: /api/errors/e78b502f7d51ab96. Report an issue: GitHub.