{"record":{"id":"bef70f239fffbe5d","repo":"jdx/mise","slug":"pacman-q-returned-no-package-for-satisfied-requir","errorCode":null,"errorMessage":"pacman -Q returned no package for satisfied requirement '{}'","messagePattern":"pacman -Q returned no package for satisfied requirement '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/pacman.rs","lineNumber":104,"sourceCode":"        .map(str::trim)\n        .filter(|line| !line.is_empty())\n        .collect()\n}\n\nfn deptest_requirement(req: &PackageRequest) -> String {\n    match &req.version {\n        Some(version) => format!(\"{}={version}\", req.name),\n        None => req.name.clone(),\n    }\n}\n\nfn apply_provider_query<'a>(\n    status: &mut PackageStatus,\n    output: &'a str,\n    constraint_satisfied: bool,\n) -> Result<&'a str> {\n    let Some((provider, version)) = parse_pacman_package(output) else {\n        bail!(\n            \"pacman -Q returned no package for satisfied requirement '{}'\",\n            status.request.name\n        );\n    };\n    // The provider's package version is display metadata; pacman -T evaluates\n    // the requested version against the version declared in Provides.\n    status.state = if constraint_satisfied {\n        PackageState::Installed {\n            version: version.to_string(),\n        }\n    } else {\n        PackageState::VersionMismatch {\n            installed: version.to_string(),\n        }\n    };\n    Ok(provider)\n}\n","sourceCodeStart":86,"sourceCodeEnd":122,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/system/packages/pacman.rs#L86-L122","documentation":"During installed() resolution, pacman -T (deptest) said a requirement is satisfied, so mise re-queries `pacman -Q <name>` to attribute it to a provider package; apply_provider_query (src/system/packages/pacman.rs:104) expects a 'name version' line on stdout and bails when there is none. It signals pacman giving inconsistent answers — the dependency is satisfied per -T but unfindable by the name-only local query — typical for virtual/provided packages and versioned provides.","triggerScenarios":"A [bootstrap.packages] entry naming a virtual package (a capability like 'awk' or a versioned 'foo=1.2') where `pacman -T` exits satisfied but `pacman -Q <name>` prints no parseable package line, because -Q resolves installed names rather than provides.","commonSituations":"Requesting capability-style virtuals instead of real package names; stale local databases after partial updates; unusual versioned provides in AUR-adjacent packages.","solutions":["Reproduce with both commands: `pacman -T <name>` (expect success) then `pacman -Q <name>` (expect the failure)","Replace the virtual name in config with the real provider package (request gawk instead of awk)","Refresh the local db (`pacman -Syu`) to clear stale state and retry","If reproducible, report to mise with both command outputs"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# reproduce the inconsistency before trusting the manager\npacman -T \"$req\" >/dev/null; echo \"deptest exit: $?\"   # 0 = satisfied\npacman -Q \"$name\"                       # must print \"name version\" for the provider","typeGuard":null,"tryCatchPattern":"if let Err(err) = pacman_manager.installed(&pkgs).await {\n    if format!(\"{err:#}\").contains(\"returned no package for satisfied requirement\") {\n        // pacman -T/-Q disagree on a virtual: replace the entry with the real provider name\n    } else {\n        return Err(err);\n    }\n}","preventionTips":["Prefer real package names over capability virtuals in [bootstrap.packages]","Refresh the local db before package status runs after partial updates"],"tags":["pacman","arch","virtual-package","mise"],"backgroundTag":"virtual-package-provider-resolution-failed","analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}