Morganamilo/paru · error · anyhow::Error

repository " " was not found

Error message

repository "{}" was not found

What it means

In sync.rs's list command (paru's equivalent of `pacman -Sl`), a requested target is neither a known named repository, the AUR namespace (with aur mode enabled), nor a local repo. paru prints this error and returns exit code 1.

Solutions

  1. Check available repos with `pacman -Sl` or `grep Server /etc/pacman.conf` and correct the name.
  2. If you meant the AUR, use `paru -Sl aur` and ensure AUR mode is enabled (not --repo-only).
  3. If it's a custom repo, confirm it is declared in pacman.conf and the local database exists.

Example fix

# before
paru -Sl multilib-testing   # not found
# after
paru -Sl multilib
# or for AUR
paru -Sl aur
Defensive patterns

Strategy: validation

Validate before calling

let repos: Vec<String> = pacman_conf_repos();
let target = "myrepo";
assert!(target == "aur" || repos.iter().any(|r| r == target), "repository {target} not found");

Try / catch

// CLI wrapper pattern
match paru_list(target).await {
    Ok(out) => println!("{out}"),
    Err(e) if e.to_string().contains("was not found") => {
        eprintln!("'{}' is not a repo; try: aur, core, extra, multilib", target);
    }
    Err(e) => return Err(e),
}

Prevention

When it happens

Trigger: Running `paru -Sl <target>` where <target> is not a configured repo name (core, extra, multilib, custom repos in pacman.conf) and not "aur" while AUR mode is on.

Common situations: Typo in repo name; querying a repo defined in an unused pacman.conf; passing "aur" while operating with --repo-only / AUR mode disabled; referencing a repo removed from pacman.conf.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of Morganamilo/paru@9ac3578807 (2026-09-12). Data as JSON: /api/errors/4577ddcf7d2e5af2. Report an issue: GitHub.

Appendix: source

Thrown at src/sync.rs:69

    } else {
        for &target in &args.targets {
            if config.alpm.syncdbs().iter().any(|r| r.name() == target) && config.mode.repo() {
                let mut args = args.clone();
                args.targets.clear();
                args.target(target);
                if let Err(e) = exec::pacman(config, &args) {
                    print_error(c.error, e);
                    ret = 1;
                }
            } else if config.pkgbuild_repos.repo(target).is_some() && config.mode.pkgbuild() {
                list_pkgbuilds(config, &config.pkgbuild_repos, target);
            } else if target == config.aur_namespace() && config.mode.aur() {
                if let Err(e) = list_aur(config).await {
                    print_error(c.error, e);
                    ret = 1;
                }
            } else {
                print_error(c.error, anyhow!("repository \"{}\" was not found", target));
                ret = 1;
            }
        }
    }

    Ok(ret)
}

pub fn list_pkgbuilds(config: &Config, repos: &PkgbuildRepos, repo: &str) {
    let stdout = std::io::stdout();
    let mut stdout = stdout.lock();

    if let Some(repo) = repos.repo(repo) {
        for pkg in repo.pkgs(config) {
            for name in pkg.srcinfo.pkgnames() {
                print_pkg(
                    config,
                    &mut stdout,

View on GitHub (pinned to 9ac3578807)