{"record":{"id":"b98ed10ee499f437","repo":"Morganamilo/paru","slug":"can-not-find-local-repo-in-pacman-conf","errorCode":null,"errorMessage":"can not find local repo '{}' in pacman.conf","messagePattern":"can not find local repo '(.+?)' in pacman\\.conf","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/config.rs","lineNumber":820,"sourceCode":"\n            if repos.is_empty() {\n                bail!(\n                    \"no local repos configured, add one to your pacman.conf:\n    [options]\n    CacheDir = /var/lib/repo/aur\n\n    [aur]\n    SigLevel = PackageOptional DatabaseOptional\n    Server = file:///var/lib/repo/aur\n\nthen initialise it with:\n    paru -Ly\"\n                );\n            }\n\n            for repo in repos {\n                if !self.pacman.repos.iter().any(|r| r.name == repo.name()) {\n                    bail!(tr!(\n                        \"can not find local repo '{}' in pacman.conf\",\n                        repo.name()\n                    ));\n                }\n            }\n        }\n\n        self.no_warn = self.no_warn_builder.build()?;\n        self.ignore_devel = self.ignore_devel_builder.build()?;\n\n        if !self.assume_installed.is_empty() && !self.chroot {\n            self.mflags.push(\"-d\".to_string());\n        }\n        if self.no_check {\n            self.mflags.push(\"--nocheck\".to_string());\n        }\n\n        if self.chroot {","sourceCodeStart":802,"sourceCodeEnd":838,"githubUrl":"https://github.com/Morganamilo/paru/blob/9ac3578807a87858651e81a02586ceb947686e7c/src/config.rs#L802-L838","documentation":"After collecting local AUR repo databases, paru checks that every such repo is registered in the parsed pacman configuration (self.pacman.repos). If a local repo DB exists on disk (e.g. in a CacheDir) but pacman.conf has no matching repository section, paru bails with 'can not find local repo {} in pacman.conf'. pacman must know the repo for paru to use it.","triggerScenarios":"A repo database file exists in a pacman CacheDir (so repo_aur_dbs sees it), but /etc/pacman.conf contains no section whose Name matches repo.name() — checked at src/config.rs:820. Also occurs if the repo section was commented out or removed while its DB file remains.","commonSituations":"User deleted the [aur] section from pacman.conf but left the DB file in the cache dir; DB file dropped in CacheDir manually; repo name in pacman.conf misspelled relative to the .db filename; pacman.conf partially reverted after an upgrade.","solutions":["Add the missing repo section to /etc/pacman.conf with a matching name, SigLevel, and Server","Uncomment the section if it was commented out","Fix the repo name in pacman.conf to match the .db filename in the CacheDir","Delete the stale DB file from the CacheDir if the repo is intentionally gone"],"exampleFix":"// before (/etc/pacman.conf)\n# [aur]\n# Server = file:///var/lib/repo/aur\n\n// after (/etc/pacman.conf)\n[aur]\nSigLevel = PackageOptional DatabaseOptional\nServer = file:///var/lib/repo/aur","handlingStrategy":"validation","validationCode":"# confirm every local repo DB in CacheDir has a section in pacman.conf\nfor db in /var/lib/repo/aur/*.db; do\n  name=$(basename \"$db\" .db)\n  grep -q \"^\\[$name\\]\" /etc/pacman.conf || echo \"$db not in pacman.conf\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Never remove a pacman.conf repo section without deleting its DB from CacheDir (or vice versa)","Match the pacman.conf section name exactly to the .db filename","Re-check pacman.conf after upgrades or manual edits before running paru"],"tags":["config","pacman","repository","pacman-conf"],"backgroundTag":"missing-required-config","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"}