{"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/afd2eddd3a50c16190efc1c7e94404b48f72af57/src/system/packages/pacman.rs#L476-L512","documentation":"The pacman provider cannot install a specific (pinned) package version because Arch repositories only carry the latest version of each package and pacman has no syntax to request an older one. When any PackageRequest has a version set, install() refuses instead of silently installing the wrong version.","triggerScenarios":"Calling install with any request whose version field is Some — e.g. `mise packages install pacman:curl=8.5.0` or a config pinning a package version while using the pacman provider.","commonSituations":"A mise.toml/[packages] config that pins versions (written for a different provider like brew/npm) is used on an Arch machine with the pacman provider; migrating a config from one OS/provider to another.","solutions":["Remove the version pin so the request only names the package and pacman installs the latest version","Use a provider that supports versioned installs (e.g. brew, cargo, npm) for that package","Install the pinned version manually via Arch Linux Archive (archive.archlinux.org) and let mise track it via status","Keep the pin but rely on the CLI's filtering, which skips pinned requests before pacman install is called"],"exampleFix":"// before (mise.toml)\n[packages]\npacman:ripgrep = \"14.1.0\"\n// after\n[packages]\npacman:ripgrep = \"latest\"","handlingStrategy":"validation","validationCode":"let pinned = pkgs.iter().filter(|p| p.version.is_some()).collect::<Vec<_>>();\nif !pinned.is_empty() { route_to_versioned_provider(&pinned)?; }","typeGuard":"fn is_pinnable(p: &PackageRequest) -> bool { !matches!(p.backend, Backend::Pacman) || p.version.is_none() }","tryCatchPattern":"match pacman.install(&pkgs, &opts).await {\n    Err(e) if e.to_string().contains(\"cannot install a pinned version\") => install_unpinned_fallback(pkgs),\n    other => other,\n}","preventionTips":["Don't pin versions for pacman-provider packages in mise.toml","Route version-pinned requests to providers with version support (brew, cargo, npm)","Keep pin and provider requirements in separate config sections per OS"],"tags":["pacman","version-pinning","unsupported-operation","arch-linux"],"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"}