{"record":{"id":"cdfbc41fedf1a240","repo":"jdx/mise","slug":"flatpak-cannot-install-a-pinned-version-pkg","errorCode":null,"errorMessage":"flatpak cannot install a pinned version ('{pkg}')","messagePattern":"flatpak cannot install a pinned version \\('(.+?)'\\)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/system/packages/flatpak.rs","lineNumber":148,"sourceCode":"            .args(args)\n            .stdin(Stdio::null())\n            .stdout(Stdio::piped())\n            .stderr(Stdio::piped())\n            .output()\n            .await?;\n        if !output.status.success() {\n            let stderr = String::from_utf8_lossy(&output.stderr);\n            bail!(\"flatpak list failed: {}\", stderr.trim());\n        }\n        Ok(parse_flatpak_list(\n            &String::from_utf8_lossy(&output.stdout),\n            pkgs,\n        ))\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!(\"flatpak cannot install a pinned version ('{pkg}')\");\n        }\n        let mut args = vec![\n            \"install\".to_string(),\n            self.scope_arg().to_string(),\n            \"--noninteractive\".to_string(),\n        ];\n        args.extend(pkgs.iter().map(|pkg| pkg.name.clone()));\n        if opts.dry_run {\n            miseprintln!(\"flatpak {}\", args.join(\" \"));\n            return Ok(());\n        }\n        run_flatpak(&args, \"install\").await\n    }\n\n    async fn upgrade(&self, pkgs: &[PackageRequest], opts: &InstallOpts) -> Result<()> {\n        if pkgs.is_empty() {\n            return Ok(());\n        }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/system/packages/flatpak.rs#L130-L166","documentation":"Flatpak cannot install a specific version of an application — it only tracks branches/remotes. The Flatpak manager's install() scans the requested PackageRequests and bails if any has a pinned version, because there is no mechanism to honor it.","triggerScenarios":"install() receives a PackageRequest whose `version` field is Some(...) — e.g. a config pinning `flatpak:org.app@1.2.3` or a version-qualified package request routed to the flatpak backend.","commonSituations":"Users writing tool configs with exact versions for flatpak packages; migrating config from brew/apt (which support pins) to flatpak without dropping the version.","solutions":["Remove the version pin and request the package by ID only (flatpak installs its default branch)","Use a different system package manager that supports pinning if an exact version is required","Pin via flatpak's own commit if you truly need immutability: `flatpak update --commit=<sha>` manually"],"exampleFix":"// before (mise.toml)\n[tools]\n\"flatpak:org.gimp.GIMP\" = \"2.10.34\"\n// after\n[tools]\n\"flatpak:org.gimp.GIMP\" = \"*\"","handlingStrategy":"validation","validationCode":"fn uses_pinned_version(reqs: &[PackageRequest]) -> bool {\n    reqs.iter().any(|r| r.version.is_some())\n}\n// reject flatpak requests with pins before calling install()","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never pin versions for flatpak packages in tool configs","Use \"*\" or omit the version for flatpak-managed tools","Choose a pin-capable backend when exact versions are required"],"tags":["flatpak","versioning","system-packages"],"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"}