{"record":{"id":"53814dce4581d08f","repo":"jdx/mise","slug":"aur-helpers-cannot-install-a-pinned-version-pkg","errorCode":null,"errorMessage":"AUR helpers cannot install a pinned version ('{pkg}')","messagePattern":"AUR helpers cannot install a pinned version \\('(.+?)'\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/aur.rs","lineNumber":180,"sourceCode":"\n    async fn installed(&self, pkgs: &[PackageRequest]) -> Result<Vec<PackageStatus>> {\n        if pkgs.is_empty() {\n            return Ok(vec![]);\n        }\n        Ok(resolve_foreign_packages(pkgs)\n            .await?\n            .into_iter()\n            .map(|package| package.status)\n            .collect())\n    }\n\n    fn supports_version_pins(&self) -> bool {\n        false\n    }\n\n    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if let Some(pkg) = pkgs.iter().find(|pkg| pkg.version.is_some()) {\n            bail!(\"AUR helpers cannot install a pinned version ('{pkg}')\");\n        }\n        let helper = self\n            .helper()\n            .ok_or_else(|| eyre::eyre!(self.unavailable_reason()))?;\n        let args = install_args(pkgs, opts);\n        let command = std::iter::once(helper.to_string())\n            .chain(args.iter().cloned())\n            .collect::<Vec<_>>();\n        if opts.dry_run {\n            miseprintln!(\"{}\", shell_words::join(command));\n            return Ok(());\n        }\n        if crate::system::sudo::is_root() {\n            bail!(\"AUR packages cannot be built as root; run mise as a non-root user\");\n        }\n        crate::system::sudo::ensure_elevation_available(&shell_words::join(&command))?;\n        let mut runner = CmdLineRunner::new(helper);\n        for arg in &args {","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/jdx/mise/blob/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/aur.rs#L162-L198","documentation":"AurManager::install() rejects any request whose PackageRequest carries a version because AUR helpers (yay/paru) can only build the latest upstream package — there is no versioned artifact to pin. If any package in the batch has `version.is_some()`, mise bails before invoking the helper. supports_version_pins() also reports false for this manager.","triggerScenarios":"Calling mise install/upgrade for an `aur:` package with a version, e.g. `mise install aur:foo@1.2.3` or a mise.toml entry like `aur = \"foo@1.2.3\"` — any pin on an AUR-backed package hits this bail.","commonSituations":"Copying an npm/go-style pinned config to an AUR package, trying to roll back an AUR package to an older version, or a mise.lock/`.tool-versions` entry that recorded a version for an AUR tool.","solutions":["Remove the version pin and install the AUR package unversioned: `mise install aur:foo` (the helper builds the latest upstream release).","If a specific version is mandatory, install it outside mise (e.g. `paru -S foo`, or build the old PKGBUILD from the AUR git history) and mark it as installed.","If you need pinning, switch the tool to a backend that supports it (github:/aqua: releases, cargo:, etc.) instead of aur:."],"exampleFix":"# before (.mise.toml)\n[tools]\n\"aur:lazygit\" = \"0.42.0\"\n\n# after\n[tools]\n\"aur:lazygit\" = \"latest\"   # or omit the version entirely; use github: for pins","handlingStrategy":"validation","validationCode":"// reject AUR version pins in config before invoking mise\nfunction assertNoAurPins(tools) {\n  for (const [name, version] of Object.entries(tools)) {\n    if (name.startsWith('aur:') && version && !['latest', '*'].includes(version)) {\n      throw new Error(`AUR package ${name} cannot be pinned (got ${version}); drop the pin or use github:`);\n    }\n  }\n}","typeGuard":"function isAurPinRequest(req: { name: string; version?: string | null }) {\n  return req.name.startsWith('aur:') && req.version != null;\n}","tryCatchPattern":"try {\n  await mise.install('aur:lazygit@0.42.0');\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"cannot install a pinned version\")) {\n    // fall back: unpin for AUR, or route to a pin-capable backend\n    await mise.install('github:cli/cli');\n  } else throw err;\n}","preventionTips":["Never write `aur:pkg@version` in mise.toml, .tool-versions, or the lockfile — AUR has no pinned artifacts.","For rollback needs, choose a backend with real releases (github:, aqua:, cargo:) instead of AUR.","Document AUR-managed tools as 'latest-only' in your team config lint rules.","If you must keep an old AUR version, install it manually via the AUR git history, not through mise pins."],"tags":["aur","arch-linux","version-pinning","unsupported-operation","package-manager"],"backgroundTag":"unsupported-operation","analyzedSha":"afd2eddd3a50c16190efc1c7e94404b48f72af57","analyzedAt":"2026-09-09T01:38:25.179Z","contentChangedAt":"2026-09-09T01:38:25.179Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}