How to Install Packages from AUR (Arch User Repository) on Arch Linux
Categories:
5 minute read
Arch Linux is renowned for its simplicity, minimalism, and cutting-edge approach. One of the greatest strengths of Arch Linux is the Arch User Repository (AUR), a vast community-maintained repository that allows users to access thousands of additional packages that are not available in the official repositories. Whether you’re a new user exploring the ecosystem or an experienced Arch enthusiast, understanding how to safely and efficiently install packages from the AUR is a key part of mastering Arch Linux.
In this guide, we’ll explore the AUR in depth—what it is, how it works, and multiple methods to install AUR packages, along with best practices and security considerations.
What is the AUR?
The Arch User Repository (AUR) is a community-driven repository that provides user-submitted build scripts (called PKGBUILDs) for software that isn’t included in the official Arch repositories. These can include:
- Proprietary software (e.g., Google Chrome)
- Pre-release or beta versions of software
- Software with unconventional licenses
- Niche tools not maintained in the official repos
Because AUR packages are not officially supported, users build them from source using the provided PKGBUILD scripts.
Benefits of the AUR
Some of the main benefits of the AUR include:
- Access to a broader range of software.
- Community contributions and feedback (packages are rated, commented on, and maintained by users).
- Learning opportunity—since packages are built from source, users gain insight into how software installation and packaging work on Linux.
Risks and Considerations
While the AUR is powerful, it also comes with responsibilities:
- Security: AUR packages are not officially vetted. You must review PKGBUILDs to ensure they don’t contain malicious code.
- Stability: Some packages may not build successfully or might conflict with your system.
- Maintenance: Since they are built from source, AUR packages may need to be manually updated or rebuilt after system upgrades.
Prerequisites
Before diving into installing AUR packages, make sure your system is up to date and has essential development tools.
sudo pacman -Syu base-devel git
base-devel
: A group of tools (likemake
,gcc
,patch
, etc.) necessary to build packages from source.git
: Required to clone AUR repositories.
Method 1: Manual Installation from the AUR
This is the most transparent and educational method.
Step-by-Step
Search for the package on the AUR website.
For example, let’s say you want to install
google-chrome
.Clone the repository:
git clone https://aur.archlinux.org/google-chrome.git cd google-chrome
Inspect the PKGBUILD:
Before proceeding, review the PKGBUILD file. This file contains instructions for building the package and can be easily edited or inspected with:
less PKGBUILD
Look for anything suspicious like unknown external scripts or commands. A good habit is to check the
source
line and associated checksums.Build and install the package:
makepkg -si
-s
: Automatically resolves and installs dependencies from official repos.-i
: Installs the built package after successful compilation.
Clean up if needed:
After installation, you can remove the cloned folder or keep it for later updates.
Method 2: Using an AUR Helper
While manually building AUR packages is educational, it can be tedious. AUR helpers automate many of these tasks, including dependency resolution, updating, and package management.
Some popular AUR helpers include:
- yay (Yet Another Yaourt): Actively maintained and widely used.
- paru: Built as a modern alternative to yay with some additional features.
- trizen, aurman, pikaur: Other alternatives, though some are less maintained.
Installing yay (Example)
Since yay itself is in the AUR, you need to install it manually first:
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Using yay
Once yay is installed, you can install any AUR package with:
yay -S <package-name>
Example:
yay -S google-chrome
Yay handles everything: dependency checks, downloading, building, and installation. You’ll also be prompted to review the PKGBUILD and associated files, which is a nice security feature.
Updating AUR Packages
With yay
yay -Syu
This updates all system and AUR packages in one go.
Manual method
If you installed a package manually, you need to update it manually:
cd ~/path/to/cloned-repo
git pull
makepkg -si
Or just reclone the updated package from AUR and rebuild it.
Searching for AUR Packages
From the Web
Visit the AUR at https://aur.archlinux.org and use the search bar.
Using yay
yay -Ss <search-term>
It will search both official and AUR packages, clearly marking AUR ones.
Removing AUR Packages
Since AUR packages are installed using pacman
, you can remove them the same way:
sudo pacman -Rns <package-name>
This command removes the package and any orphaned dependencies.
Best Practices for Using the AUR
- Always read PKGBUILD files before installation.
- Avoid installing unsupported software on critical systems.
- Use
makepkg
or AUR helpers in a clean environment (like a chroot or container) if you’re cautious. - Don’t install AUR packages as root—
makepkg
should always be run as a regular user. - Watch for orphaned AUR packages—if a maintainer disappears, the package may become outdated or broken.
- Use
namcap
to lint PKGBUILDs if creating or editing your own. - Use
checkupdates
(frompacman-contrib
) andyay
to monitor updates. - Subscribe to comments or issues on packages you rely on.
Creating Your Own AUR Package
If a package isn’t available in the AUR, you can submit your own. The process involves:
- Creating a
PKGBUILD
. - Testing it locally with
makepkg
. - Registering an AUR account.
- Publishing with Git to the AUR repository.
The Arch Wiki has excellent guidelines on packaging.
Troubleshooting Common Issues
1. Missing Dependencies
If a build fails due to missing dependencies, double-check the depends
array in the PKGBUILD and install missing ones manually.
2. Checksum Errors
Sometimes sources change upstream without the PKGBUILD being updated. You can fix this by running:
updpkgsums
Then rerun makepkg
.
3. Build Failures
Read the build output carefully—it often points to missing tools or system mismatches. Sometimes a package just isn’t maintained anymore.
Conclusion
The Arch User Repository is one of the most powerful and flexible features of Arch Linux. While it introduces more responsibility compared to binary package managers, it greatly expands what you can do with your system. Whether you’re installing a proprietary browser, a bleeding-edge code editor, or a rare scientific tool, the AUR probably has it.
Always approach the AUR with a balance of curiosity and caution. Learn to inspect PKGBUILDs, use helpers like yay wisely, and embrace the DIY spirit of Arch. In return, you’ll enjoy a level of control and customization few Linux distributions offer.
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.