{"record":{"id":"ed1c00f2703bddab","repo":"Morganamilo/paru","slug":"duplicate-pkgbuild","errorCode":null,"errorMessage":"duplicate PKGBUILD: {}","messagePattern":"duplicate PKGBUILD: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/download.rs","lineNumber":291,"sourceCode":"\n    for &targ in pkgbuild {\n        let Some((base, _)) = config.pkgbuild_repos.target(config, targ) else {\n            eprintln!(\n                \"{} {}\",\n                color.error.paint(\"error:\"),\n                tr!(\"package '{}' was not found\", targ.pkg),\n            );\n            ret = 1;\n            continue;\n        };\n\n        match pkgs.entry(base.srcinfo.pkgbase()) {\n            Entry::Vacant(v) => {\n                v.insert(base);\n            }\n            Entry::Occupied(o) => {\n                if o.get().repo != base.repo {\n                    bail!(tr!(\"duplicate PKGBUILD: {}\", base.srcinfo.pkgbase()))\n                }\n            }\n        }\n    }\n\n    for (n, pkg) in pkgs.values().enumerate() {\n        let path = cwd.join(pkg.srcinfo.pkgbase());\n        print_download(config, n + 1, pkgs.len(), pkg.srcinfo.pkgbase());\n\n        if path.exists() {\n            if !path.join(\"PKGBUILD\").exists() {\n                eprintln!(\n                    \"{} {}\",\n                    color.error.paint(\"error:\"),\n                    tr!(\n                        \"package '{}' exists but has no PKGBUILD -- skipping\",\n                        pkg.srcinfo.pkgbase(),\n                    ),","sourceCodeStart":273,"sourceCodeEnd":309,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/download.rs#L273-L309","documentation":"aura refuses to proceed when two requested packages share the same PKGBUILD base but come from different repositories (e.g. one from AUR, one from an explicit repo overlay). Since one build directory can only serve one source for a pkgbase, processing both would silently build the wrong package, so pkgbuild_pkgbuilds bails out during getpkgbuilds.","triggerScenarios":"Calling getpkgbuilds with a target list containing two packages whose srcinfo pkgbase() is identical but whose repo fields differ; the Entry::Occupied branch in the pkgs map detects the repo mismatch and bails.","commonSituations":"Requesting both a repo package and an AUR package with the same base name (e.g. a renamed or duplicated AUR package shadowing an official one); having a custom repo that provides a package also present in AUR; typos in a package list referencing both variants.","solutions":["Remove one of the conflicting packages from the target list so only one source per pkgbase is requested","Check which repo each duplicate comes from and disambiguate with repo-qualified names if supported","If a stale custom repo provides the duplicate, update or remove that repo entry","If you maintain the AUR package, rename it so its pkgbase no longer collides with the repo package"],"exampleFix":"// before\nparu -G linux linux\n// after (request only one source per pkgbase)\nparu -G linux","handlingStrategy":"validation","validationCode":"// dedupe targets by pkgbase before requesting\nlet mut seen = std::collections::HashSet::new();\ntargets.retain(|t| seen.insert(pkgbase_of(t)));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never mix repo and AUR sources for the same pkgbase in one command","Audit custom repo lists for packages that shadow AUR names","Qualify package names when a repo and AUR package collide"],"tags":["pkgbuild","duplicate-package","aur","resolution"],"backgroundTag":"conflicting-config-options","analyzedSha":"9ac3578807a87858651e81a02586ceb947686e7c","analyzedAt":"2026-09-12T04:57:59.861Z","contentChangedAt":"2026-09-12T04:57:59.861Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}