Jguer/yay · error · ErrABSPackageNotFound
package not found in repos
Error message
package not found in repos
What it means
Sentinel error ErrABSPackageNotFound from pkg/download/abs.go signals that the Arch Build System (ABS) fetch found no package at the given URL. ABSPKGBUILD builds a gitlab.archlinux.org URL for the package and checks the HTTP response; any non-200 status (most importantly 404) is converted to this error. It means the requested package does not exist in the configured repositories, not that the network failed.
Solutions
- Verify the package name is spelled correctly and exists in an official repo (pacman -Si <name> or the Arch package search).
- Check whether the package only exists in the AUR — if so, fetch the PKGBUILD from the AUR instead of ABS.
- Refresh local sync databases (pacman -Sy) and retry, since stale metadata can reference removed packages.
- Retry after a short delay if GitLab was returning a transient non-200 (5xx).
Example fix
// before
pkgbuild, err := download.ABSPKGBUILD(ctx, "brltty-nonexistent")
// after
if _, err := exec.Command("pacman", "-Si", pkgname).Run(); err != nil {
// fall back to AUR or abort before calling ABSPKGBUILD
return fmt.Errorf("%s not found in official repos; trying AUR", pkgname)
}
pkgbuild, err := download.ABSPKGBUILD(ctx, pkgname) Defensive patterns
Strategy: validation
Validate before calling
// Pre-check package existence before calling ABSPKGBUILD
func pkgInRepos(pkg string) bool {
return exec.Command("pacman", "-Si", pkg).Run() == nil
}
if !pkgInRepos(pkgname) {
// route to AUR or abort
} Type guard
func isABSPackageNotFound(err error) bool {
return errors.Is(err, download.ErrABSPackageNotFound)
} Try / catch
pkgbuild, err := download.ABSPKGBUILD(ctx, pkgname)
if err != nil {
if errors.Is(err, download.ErrABSPackageNotFound) {
return fmt.Errorf("package %q not found in repos; check spelling or use AUR", pkgname)
}
return err // network or other failure
} Prevention
- Verify package names against official repo listings before fetching PKGBUILDs
- Handle AUR-only packages through a separate code path
- Refresh sync databases before lookups
- Treat transient GitLab 5xx with a bounded retry before concluding the package is absent
When it happens
Trigger: Calling ABSPKGBUILD with a pkgname that has no package in the ABS repository, or with a repo value that does not host it; the GitLab request returns 404 (or another non-200) and abs.go:71 maps it to this sentinel.
Common situations: Typo in a package name when building from source; AUR-only or renamed/removed packages that no longer exist in the official repos; stale local repo metadata listing a package that was deleted upstream; transient GitLab 5xx also surfaces as this error.
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 Jguer/yay@328f4b4939 (2026-09-07).
Data as JSON: /api/errors/f6c7ffb9b93de7f0.
Report an issue: GitHub.
Appendix: source
Thrown at pkg/download/abs.go:23
"errors"
"fmt"
"io"
"net/http"
"regexp"
"github.com/leonelquinteros/gotext"
"github.com/Jguer/yay/v13/pkg/settings/exe"
)
const (
MaxConcurrentFetch = 20
absPackageURL = "https://gitlab.archlinux.org/archlinux/packaging/packages"
)
var (
ErrInvalidRepository = errors.New(gotext.Get("invalid repository"))
ErrABSPackageNotFound = errors.New(gotext.Get("package not found in repos"))
)
type regexReplace struct {
repl string
match *regexp.Regexp
}
// regex replacements for Gitlab URLs
// info: https://gitlab.archlinux.org/archlinux/devtools/-/blob/6ce666a1669235749c17d5c44d8a24dea4a135da/src/lib/api/gitlab.sh#L84
var gitlabRepl = []regexReplace{
{repl: `$1-$2`, match: regexp.MustCompile(`([a-zA-Z0-9]+)\+([a-zA-Z]+)`)},
{repl: `plus`, match: regexp.MustCompile(`\+`)},
{repl: `-`, match: regexp.MustCompile(`[^a-zA-Z0-9_\-.]`)},
{repl: `-`, match: regexp.MustCompile(`[_\-]{2,}`)},
{repl: `unix-tree`, match: regexp.MustCompile(`^tree$`)},
}
// Return format for pkgbuildView on GitHub (pinned to 328f4b4939)