jdx/mise · error

pacman cannot install a pinned version ('{p}'): Arch reposit

Error message

pacman cannot install a pinned version ('{p}'): Arch repositories only provide the latest version

What it means

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.

Source

Thrown at src/system/packages/pacman.rs:494

            let provider = apply_provider_query(status, &packages, constraint_satisfied)?;
            debug!(
                "pacman: {} is satisfied by installed provider {}",
                status.request.name, provider.name,
            );
        }
        Ok(statuses)
    }

    fn supports_version_pins(&self) -> bool {
        false
    }

    async fn install(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {
        // Arch repos only carry the latest version — pacman has no syntax to
        // install an older one, so a pin can be checked (status) but not
        // satisfied here; the CLI filters pinned requests out before calling
        if let Some(p) = pkgs.iter().find(|p| p.version.is_some()) {
            bail!(
                "pacman cannot install a pinned version ('{p}'): Arch repositories only \
                 provide the latest version"
            );
        }
        if opts.update || self.dbs_missing() {
            self.refresh(opts)?;
        }
        let mut args = vec![
            "-S".to_string(),
            "--noconfirm".to_string(),
            "--needed".to_string(),
            // `--` keeps package operands from being parsed as pacman options
            "--".to_string(),
        ];
        args.extend(pkgs.iter().map(|p| p.name.clone()));
        if opts.dry_run {
            miseprintln!("{}", sudo::argv("pacman", &args).join(" "));
            return Ok(());

View on GitHub (pinned to afd2eddd3a)

Solutions

  1. Remove the version pin so the request only names the package and pacman installs the latest version
  2. Use a provider that supports versioned installs (e.g. brew, cargo, npm) for that package
  3. Install the pinned version manually via Arch Linux Archive (archive.archlinux.org) and let mise track it via status
  4. Keep the pin but rely on the CLI's filtering, which skips pinned requests before pacman install is called

Example fix

// before (mise.toml)
[packages]
pacman:ripgrep = "14.1.0"
// after
[packages]
pacman:ripgrep = "latest"
Defensive patterns

Strategy: validation

Validate before calling

let pinned = pkgs.iter().filter(|p| p.version.is_some()).collect::<Vec<_>>();
if !pinned.is_empty() { route_to_versioned_provider(&pinned)?; }

Type guard

fn is_pinnable(p: &PackageRequest) -> bool { !matches!(p.backend, Backend::Pacman) || p.version.is_none() }

Try / catch

match pacman.install(&pkgs, &opts).await {
    Err(e) if e.to_string().contains("cannot install a pinned version") => install_unpinned_fallback(pkgs),
    other => other,
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


AI-assisted analysis of jdx/mise@afd2eddd3a (2026-09-09). Data as JSON: /api/errors/ef7d235bb18aca0f. Report an issue: GitHub.