Come hang with us on Discord and chat directly with the team!Discordtop-bar-close-icon

2024-09-17

How to Install Packages in Arch Linux from AUR

tutorials
img

Arch Linux is renowned for its extensive software availability from both official repositories and the AUR. This guide explores various methods to install packages in Arch Linux.

AUR (Arch User Repository) is a community-driven platform for Arch Linux enthusiasts. It was established to organize and share new packages, facilitating the inclusion of popular packages into the repository. The repository includes package descriptions called PKGBUILD, which enable users to compile packages from source using the makepkg command, followed by installation through the native pacman command.

To simplify the process, AUR offers "helpers" or tools to easily download PKGBUILD files and initiate the compilation process with minimal steps. This is the preferred method for Arch Linux users who prefer not to compile from source. We will focus on two major AUR helpers:

  1. Yaourt
  2. Packer

Installing Packages Using Yaourt

Yaourt, an acronym for Yet AnOther User Repository Tool, is a package wrapper that facilitates the installation of AUR packages. It serves as a wrapper for pacman with extended features including AUR support.

How to Install Yaourt

Yaourt can be installed using two methods:

  1. Using a custom repository
  2. Using AUR

Installing Yaourt Using a Custom Repository

Edit pacman's configuration file with your preferred text editor:

$ sudo nano /etc/pacman.conf

Append the following lines:

[archlinuxfr]
SigLevel = Never
Server = http://repo.archlinux.fr/$arch

Save and exit. Then, update the repository database and install Yaourt:

sudo pacman -Sy yaourt

Installing Yaourt Using AUR

This method is more involved. Follow these steps:

sudo pacman -S --needed base-devel git wget yajl
git clone https://aur.archlinux.org/package-query.git
cd package-query/
makepkg -si
git clone https://aur.archlinux.org/yaourt.git
cd yaourt/
makepkg -si
  1. Install required dependencies:
  2. Clone the package-query repository:
  3. Navigate to the package-query directory:
  4. Compile and install, then exit the directory:
  5. Clone the latest Yaourt repository:
  6. Navigate into the yaourt directory:
  7. Compile and build Yaourt:

Yaourt is now installed. Use the following syntax to install packages:

yaourt -S packagename

Update your Arch Linux system:

yaourt -Syu

Upgrade installed packages:

yaourt -U packagename

Build a package from PKGBUILD:

yaourt -P directory

Installing Packages Using Packer

Packer is another tool that simplifies the process of compiling and installing packages from AUR. It allows users to install, upgrade, search, and get information about packages.

Installing Packer

First, install the required dependencies:

sudo pacman -S base-devel fakeroot jshon expac git wget

Download the PKGBUILD script from AUR:

wget https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h=packer

Rename the folder for convenience:

mv PKGBUILD?h=packer PKGBUILD

Compile the package and create the installation file:

makepkg

Finally, install Packer:

sudo pacman -U packer-*.pkg.tar.xz

Packer is now installed. Use the following command to install packages:

packer -S packagename

Update all AUR packages:

packer -Syu

Closing Thoughts

This guide provides insights into installing packages on Arch Linux using Yaourt and Packer. Stay tuned for more informative articles. Cheers!