Devolutions/UniGetUI · warning · InvalidOperationException
Pacman does not support installing arbitrary versions
Error message
Pacman does not support installing arbitrary versions
What it means
Pacman's GetInstallableVersions_UnSafe unconditionally throws InvalidOperationException. Pacman resolves versions from synced repositories and does not provide an arbitrary installable-version list.
Source
Thrown at src/UniGetUI.PackageEngine.Managers.Pacman/Helpers/PacmanPkgDetailsHelper.cs:166
string? result = null;
string? line;
while ((line = p.StandardOutput.ReadLine()) is not null)
{
if (result is not null) continue;
var spaceIdx = line.IndexOf(' ');
if (spaceIdx < 0) continue;
var path = line[(spaceIdx + 1)..].Trim();
if (Directory.Exists(path))
result = path;
}
p.StandardError.ReadToEnd();
p.WaitForExit();
return result;
}
protected override IReadOnlyList<string> GetInstallableVersions_UnSafe(IPackage package)
=> throw new InvalidOperationException("Pacman does not support installing arbitrary versions");
private static long ParsePacmanSize(string value)
{
// Format: "2.34 MiB", "234.56 KiB", "1.20 GiB"
var parts = value.Split(' ');
if (parts.Length < 2 || !double.TryParse(parts[0],
System.Globalization.NumberStyles.Any,
System.Globalization.CultureInfo.InvariantCulture, out var num))
return 0;
return parts[1] switch
{
"KiB" or "kB" => (long)(num * 1024),
"MiB" or "MB" => (long)(num * 1024 * 1024),
"GiB" or "GB" => (long)(num * 1024 * 1024 * 1024),
_ => (long)num,
};
}View on GitHub (pinned to 9b1d7d0eab)
Solutions
- Gate version requests on the capability flag for Pacman.
- Install via the repository version without a version pin.
- Catch InvalidOperationException and surface only the current version.
Example fix
// before
var versions = await pkg.GetInstallableVersionsAsync(); // throws for pacman
// 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 Pacman.
- Install via the repository version without a pin.
- Hide the version picker for Arch packages.
When it happens
Trigger: Any code path requesting installable versions for a Pacman package (version picker, pre-install resolution).
Common situations: UI version dropdown for an Arch/pacman package; 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
- Homebrew 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/111e2054fa18607f.
Report an issue: GitHub.