Repositories in Arch Linux: official and AUR
There are two types of repositories on Arch Linux: official repositories (accesible via pacman) and the Arch User Repository. In this tutorial you will understand the differences and how to install packages from each one.
Table of Contents
Official repositories
Contain essential and popular software you can install via pacman
(Check Package managers in Linux). These packages are constantly upgraded: do not depend on the operating system version, like in Ubuntu, whose official repositories only receive security and minor package upgrades until a new version of Ubuntu is released.
Inside these official respositories there are two types: stable and testing. Inside stable repositories there are four repositories:
- core (needed packages for Arch Linux to work).
- extra (packages that do not fit in “core”, like Xorg, web browsers, media players, etc.).
- community (popular software in AUR that have been adopted by Trusted Users).
- multilib (32-bit software and libraries that can be used to run and build 32-bit applications on 64-bit installs).
Adding repositories
- Create a file inside
/etc/pacman.d
and add mirror info.Server = https://archzfs.com/$repo/$arch
- Edit
/etc/pacman.conf
to add the link to the mirror-list file.[archzfs] Include = /etc/pacman.d/mirrorlist-archzfs
Arch User Repository
It’s a community-driven repository. This repository doesn’t contain binaries but package descriptions (PKGBUILD
) that allow you to compile the software and then install it with pacman
(indeed it contains some binaries, but is not its main purpose).
Installing software
The process of installing software from AUR is relatively simple:
- (Prerequisite) Install
base-devel
andgit
packages.sudo pacman -S --needed base-devel git
- Search the package you want in AUR home page.
- Clone its git repository.
git clone https://aur.archlinux.org/package_name.git
- You can also download a snapshot and unpack it.
- Acquire a PGP public key if needed (More info).
- Build the package.
cd <package_name>
# review PKGBUILD for malicious or dangerous commands less PKGBUILD
# make the package makepkg
- Check Arch Wiki for more info on
makepkg
.
- Check Arch Wiki for more info on
- Install the package with
pacman
.sudo pacman -U <package_name>-<version>-<architecture>.pkg.tar.zst
AUR helpers
AUR helpers are programs that automate the process of search and install packages from AUR. Some helpers simplify the search and download process, others the search and build process and there are some helpers that work in a similar way to pacman
. These are some examples:
yay
Works like pacman
(Package managers), adding -a
parameter to specify you want to use AUR.
- Install
sudo pacman -S --needed git base-devel git clone https://aur.archlinux.org/yay-bin.git cd yay-bin makepkg -si
- Use (like
pacman
)# Search only in AUR yay -aSs <search term> # Install an AUR package yay -aS <package name>
aura
git clone https://aur.archlinux.org/aura-bin.git
cd aura-bin
makepkg
sudo pacman -U <the-package-file-that-makepkg-produces>
If you have any suggestion, feel free to contact me via social media or email.
Latest tutorials and articles:
Featured content: