{"record":{"id":"ef7d235bb18aca0f","repo":"jdx/mise","slug":"pacman-cannot-install-a-pinned-version-p-ar","errorCode":null,"errorMessage":"pacman cannot install a pinned version ('{p}'): Arch repositories only provide the latest version","messagePattern":"pacman cannot install a pinned version \\('(.+?)'\\): Arch repositories only provide the latest version","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/pacman.rs","lineNumber":494,"sourceCode":"            let provider = apply_provider_query(status, &packages, constraint_satisfied)?;\n            debug!(\n                \"pacman: {} is satisfied by installed provider {}\",\n                status.request.name, provider.name,\n            );\n        }\n        Ok(statuses)\n    }\n\n    fn supports_version_pins(&self) -> bool {\n        false\n    }\n\n    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        // Arch repos only carry the latest version — pacman has no syntax to\n        // install an older one, so a pin can be checked (status) but not\n        // satisfied here; the CLI filters pinned requests out before calling\n        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {\n            bail!(\n                \"pacman cannot install a pinned version ('{p}'): Arch repositories only \\\n                 provide the latest version\"\n            );\n        }\n        if opts.update || self.dbs_missing() {\n            self.refresh(opts)?;\n        }\n        let mut args = vec![\n            \"-S\".to_string(),\n            \"--noconfirm\".to_string(),\n            \"--needed\".to_string(),\n            // `--` keeps package operands from being parsed as pacman options\n            \"--\".to_string(),\n        ];\n        args.extend(pkgs.iter().map(|p| p.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"{}\", sudo::argv(\"pacman\", &args).join(\" \"));\n            return Ok(());","sourceCodeStart":476,"sourceCodeEnd":512,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/pacman.rs#L476-L512","documentation":"Arch repositories only host the latest version of each package and pacman has no syntax to install an older one, so mise refuses `install` calls whose request list contains a version-pinned package. The pinned package can still be *checked* (status), but it cannot be *satisfied* through pacman. Normally the CLI filters pinned requests out before reaching the backend; hitting this error means a pinned request leaked through.","triggerScenarios":"Calling the pacman backend's `install` directly (or via an API path that does not pre-filter) with a `PackageRequest` whose `version` field is `Some`, e.g. `mise install` of a tool whose mise.toml entry pins a version but which is backed by pacman.","commonSituations":"A mise.toml/.tool-versions entry pins e.g. `ripgrep@14.1.0` while the tool resolves to the pacman backend; an older mise version or a plugin path bypasses the pinned-request filter; a user hand-edits config to add a version to a system-package tool.","solutions":["Remove the version pin for that tool (use bare `tool = \"latest\"` or just the name) and let Arch provide its current version.","Switch the tool to a mise-managed backend (aqua/github/cargo/etc.) that supports arbitrary versions, via `mise use aqua:<owner/repo>` or similar.","Install the specific older version manually with pacman-compatible means (e.g. a cached .pkg.tar.zst via `pacman -U`) outside mise, then let mise detect it as installed.","Update mise — newer CLI versions filter pinned requests before invoking the pacman backend."],"exampleFix":"# before (mise.toml)\n[tools]\nripgrep = \"14.1.0\"\n\n# after\n[tools]\nripgrep = \"latest\"  # or use a versioned backend: mise use aqua:BurntSushi/ripgrep","handlingStrategy":"validation","validationCode":"// Refuse pinned versions for pacman-backed tools before invoking mise\nconst pacmanTools = { ripgrep: 'pacman' };\nfor (const [tool, version] of Object.entries(tools)) {\n  if (pacmanTools[tool] && version && version !== 'latest') {\n    throw new Error(`${tool}: remove the pin or switch to a backend that supports versions (aqua:, cargo:, ...)`);\n  }\n}","typeGuard":"const isPinned = (req) => typeof req === 'string' && /[0-9]/.test(req) && req !== 'latest';","tryCatchPattern":"try { await miseInstall('ripgrep@14.1.0') } catch (e) { if (String(e).includes('cannot install a pinned version')) { console.error('Use `mise use aqua:BurntSushi/ripgrep` for pinned installs'); } else throw e; }","preventionTips":["Never pin versions on tools resolved to system package backends (pacman/apk/dnf); pin only with versioned backends.","Keep mise updated so the CLI's pinned-request filtering stays in effect.","If you need an exact version on Arch, use `mise use aqua:<owner/repo>` or `mise use cargo:<crate>` instead.","Document in team mise.toml why a tool is unpinned to prevent someone adding a pin later."],"tags":["pacman","version-pinning","unsupported-operation","arch-linux"],"backgroundTag":"unsupported-operation","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}