Devolutions/UniGetUI · warning · InvalidOperationException
Homebrew does not support installing arbitrary versions
Error message
Homebrew does not support installing arbitrary versions
What it means
Homebrew's GetInstallableVersions_UnSafe unconditionally throws InvalidOperationException. Homebrew installs the current formula/cask head and does not expose a selectable version catalog, so arbitrary-version listing is unsupported.
Source
Thrown at src/UniGetUI.PackageEngine.Managers.Homebrew/Helpers/HomebrewPkgDetailsHelper.cs:122
protected override string? GetInstallLocation_UnSafe(IPackage package)
{
// Apple Silicon prefix is /opt/homebrew, Intel/Linux is /usr/local (or /home/linuxbrew).
// Formulae live under Cellar/<name>, casks under Caskroom/<token>.
foreach (var prefix in new[] { "/opt/homebrew", "/usr/local", "/home/linuxbrew/.linuxbrew" })
{
foreach (var kind in new[] { "Cellar", "Caskroom" })
{
var path = Path.Join(prefix, kind, package.Id);
if (Directory.Exists(path))
return path;
}
}
return null;
}
protected override IReadOnlyList<string> GetInstallableVersions_UnSafe(IPackage package)
=> throw new InvalidOperationException("Homebrew does not support installing arbitrary versions");
}
View on GitHub (pinned to 9b1d7d0eab)
Solutions
- Gate version requests on the capability flag for Homebrew.
- Install the current formula/cask without a version pin.
- Catch InvalidOperationException and surface only the installed version.
Example fix
// before
var versions = await pkg.GetInstallableVersionsAsync(); // throws for brew
// after
if (pkg.Manager.Capabilities.SupportsArbitraryVersions)
versions = await pkg.GetInstallableVersionsAsync();
else
versions = [pkg.Version]; Defensive patterns
Strategy: validation
Validate before calling
if (package.Manager.Capabilities.SupportsArbitraryVersions)
versions = package.GetInstallableVersionsAsync();
else
versions = new[] { package.Version }; Type guard
static bool CanListVersions(IPackage pkg) =>
pkg.Manager.Capabilities.SupportsArbitraryVersions; Prevention
- Gate version requests on the capability flag for Homebrew.
- Install the current formula/cask without a version pin.
- Hide the version picker for brew packages.
When it happens
Trigger: Any code path requesting installable versions for a Homebrew package (version picker, pre-install resolution).
Common situations: UI version dropdown for a brew formula/cask; automation expecting a version list.
Related errors
- APT does not support installing arbitrary versions
- DNF does not support installing arbitrary versions
- Flatpak does not support installing arbitrary versions
- Pacman does not support installing arbitrary versions
- {expectedName} maintenance actions can only run against the
AI-assisted analysis of Devolutions/UniGetUI@9b1d7d0eab (2026-08-13).
Data as JSON: /api/errors/f9b4ffb290cc6ddb.
Report an issue: GitHub.