[HowTo] Fix a failing AUR package build

Difficulty: ★★☆☆☆

AUR packages, contrarily to packages available in Manjaro’s repositories, need to be built locally in order to be installed. And as any process, that building can also fail for various reasons.

:information_source: Technically, what are hosted in AUR are not packages but PKGBUILDs, scripts describing how to build packages. For more details, see: PKGBUILD - ArchWiki

:warning: As its name implies, the Arch User Repository is a community maintained repository towards Arch Linux. Despite most packages being de-facto binary compatible with Manjaro, no Arch-derived distribution is officially supported. For more details, see: [HowTo] Use the AUR

Reason of failure

Whenever an AUR package fails to build or install, the reason should be printed in the output for you to see. Fixing the build or installation is thus usually simply a matter of reading the errors and acting accordingly.

Possible errors and solutions

- configure: error: no acceptable C compiler found in $PATH
- CMake Error: CMake was unable to find a build program corresponding to…
- ERROR: Cannot find the <command> binary…
- <command>: command not found
You likely lack some utilities needed for building the package.

sudo pacman -S --needed base-devel

- could not satisfy dependencies
- ERROR: Dependency “<application>” not found
- Missing dependencies
- unable to satisfy dependency
The AUR package has a dependency requirement that could not be met. There are multiple cases:

  1. The dependency is not installed.
    Dependencies from the Manjaro repositories may be automatically installed in the process. If that wasn’t the case, or if the dependency is another AUR package, you can manually install them first.
  • :star: If you don’t find the relevant missing dependency, you can refer to the dependencies listed on the associated AUR page to guide you.
  1. The dependency is installed, but the requirement is not resolved.
    This is often the case when the AUR package requires a specific version of the dependency. Since repository packages are available in Manjaro later than in Arch, the newer version may not be available yet: [HowTo] Update an application early to the latest version

- ERROR: <file> was not found in the build directory and is not a URL.
A file is missing in order to build the package. Check all needed files have been downloaded and try again.

- ERROR: A failure occurred in build()
If the previous solutions did not solve your issue, then it most likely comes from an error in the PKGBUILD and/or in the code itself. Your best chance is to check, and possibly notify, for that issue in the associated AUR page.

:warning: Even though AUR helpers such as pamac and yay automate the steps needed for building and installing an AUR package, they are not officially supported. Before notifying any issue upstream, you shall first reproduce it by building manually.

15 Likes