How to Install Arch AUR Packages using Terminal?

Follow this step-by-step guide on how to effortlessly install Arch AUR packages using terminal without build the packages manually yourself.

Install an AUR Helper

Follow this link https://wiki.archlinux.org/title/AUR_helpers, which has a list of various AUR helpers compared in detail.

Basically, an AUR helper is a cli programme that lets you install and update packages from Arch's AUR repository.

Make sure that the AUR helper you choose supports your shell. if you use fish or zsh.

Build & Install the Helper

I've chosen YAY as my AUR Helper.

Once you have chosen your preferred AUR Helper, click on the link and go to the AUR package download page, where you can see the Download Snapshot link on the right side.

Download AUR Helper

Click on it, download the zip or tar.gz file on your system, and extract it.

Gnome File Manager

Open the extracted folder's path in your terminal emulator.

Then run makepkg -sri command.

Makepkg -sri Installing AUR Helper

It may ask you to enter your password; once it is done, issue the following command to make sure the package is installed.

yay --version

Install Packages With AUR Helper

You can simply search for a package using the following command:

yay discord search in yay

Then you can just type the number corresponding to the package you want to install and hit enter.

You can also search for packages using this command.

yay -Ss discord

You can directly install packages using this command.

yay -S google-chrome

You can update packages using this command.

yay -Syu

You can use most of the Pacman commands with yay, but make sure you don't put sudo in front of yay commands.

How to Remove Packages?

You can remove AUR packages like any other packages using the following command:

sudo pacman -R package_name
sudo pacman -Rns package_name

-R will remove only the package where -Rns will remove the package with all its dependencies.