How to Install Yay AUR Helper in Arch Linux and Manjaro

The two commonly used AUR helpers in Arch Linux are Yaourt and Packer. You can easily use them for Arch Linux package management tasks such as installing and updating packages.

However, the two have been discontinued in favour of yay, short for Yet Another Yaourt. Yay is a modern AUR helper written in the GO language. It has very few dependencies and supports AUR tab completion so that you don’t have to type the commands in full. Just type the first few letters and hit ENTER.

In this article, we demonstrate how you can install Yay AUR helper on Arch Linux or Manjaro which is based on Arch, and see a few examples of how you can use Yay.

Installing Yay AUR Helper in Arch Linux and Manjaro

To start off, log in as a sudo user and run the command below to download the git package.

$ sudo pacman -S git
Install Git on Arch Linux
Install Git on Arch Linux

Next, clone the yay git repository.

$ cd /opt
$ sudo git clone https://aur.archlinux.org/yay-git.git
Clone Yay Git Repository
Clone Yay Git Repository

Change the file permissions from the root to the sudo user.

$ sudo chown -R tecmint:tecmint ./yay-git
Set Permissions on Yay AUR Helper
Set Permissions on Yay AUR Helper

To build the package from PKGBUILD, navigate into the yay folder.

$ cd yay-git

Next, you need to install base-devel package that includes essential development tools and libraries commonly used for building and compiling software.

$ sudo pacman -S --needed base-devel
$ makepkg -si
Install Yay AUR Helper in Arch Linux
Install Yay AUR Helper in Arch Linux

How to Use Yay in Arch Linux and Manjaro

Once you have yay installed, you can upgrade all the packages on your system using the command.

$ sudo yay -Syu

To include development packages during the upgrade run.

$ yay -Syu --devel --timeupdate

As with any other AUR helpers, you can install the packages using the command.

$ sudo yay -S gparted

To remove a package using yay use the command.

$ sudo yay -Rns package_name

To clean up all unwanted dependencies on your system, issue the command.

$ sudo yay -Yc

If you want to print system statistics using yay, run.

$ sudo yay -Ps

And this sums up this brief tutorial on how you can install the yay AUR helper in Arch Linux and Manjaro.

James Kiarie
This is James, a certified Linux administrator and a tech enthusiast who loves keeping in touch with emerging trends in the tech world. When I'm not running commands on the terminal, I'm taking listening to some cool music. taking a casual stroll or watching a nice movie.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

24 Comments

Leave a Reply
  1. Please take this post down or at least, issue a warning at the top. As written, it doesn’t work and gets warnings in the end. (Fedora 38 installing Arch). We shouldn’t need to skip down to the comments section to see corrections that should be implemented into the body.

    Thank you.

    Reply
    • @Strob,

      Thank you for your feedback, and we appreciate your concern. We apologize for any inconvenience the post may have caused. We have updated the content and make the necessary changes to ensure it works smoothly…

      Reply
  2. You need to add sudo pacman -S --needed base-devel

    Can’t run makepage -si without the base packages to run this command

    Otherwise, end up with
    ==> ERROR: Cannot find the fakeroot binary.
    ==> ERROR: Cannot find the strip binary required for object file stripping.

    Reply
    • Ops forgot.

      $ sudo pacman -S --needed base-devel
      

      Must add all 12 in order for this to work.
      1) autoconf 2) automake 3) binutils 4) bison 5) fakeroot 6) flex
      7) gcc 8) m4 9) make 10) patch 11) pkgconf

      Reply
  3. Hi, my recommendation:

    1. Don’t install yay under “opt” directory, use your home directory.c
    2. Then, “chown” commands are not needed.
    3. Don’t use “sudo” with yay like when you use “pacman” (increses security).

    Install yay is very easy and secure under your home directory:

    $ sudo pacman -S git [optional if you have installed it]
    $ git clone https://aur.archlinux.org/yay-git.git
    $ cd yay-git/
    $ makepkg -si
    $ cd .. && sudo rm -r yay-git
    

    6. Enjoy yay!

    Reply
  4. Why the hell “sudo” the build? this is utterly wrong, useless, dangerous, and a bad habit.
    (just like building things in “/opt”)

    1. git clone in your home dir as a regular user.
    2. makepkg -s from there (note : without the “i”).
    3. THEN only install the package with pacman : it’s the only moment root privileges are required. : pacman -U.
    Reply
  5. Hi and thanks for the article! Is yay install dependencies are needed for a package? for example, MPV is a dependency for smplayer; If I type yay -S smplayer, It will install MPV as well or I have to install it manually?

    thanks for your respond

    Reply
    • Hey gadzhi, tecmint is a Linux user with a corresponding group called tecmint. So in your case, this could be something else.

      $ sudo chown -R tecmint:tecmint yay-git
      

      In your case use the syntax:

      $ sudo chown -R user:group yay-git
      
      Reply
  6. Thanks for the article! I’m new to Manjaro (I was using Kubuntu before). I can say that the switch was worth it! It is very fast when compared to Kubuntu and other Ubuntu-based distros. I was able to install yay without any issues. Just needed to tell something that the package base-devels are needed for this to work. I had to run sudo pacman -S base-devels before I could install yay.

    Reply
    • yay‘ is for releases, whereas ‘yay-git‘ is the package for the git upstream repo.

      This is a standard AUR convention.

      The typo is putting the forward-slash before the directory name in the chown command.

      $ sudo chown -R tecmint:tecmint /yay-git
      

      should be:

      $ sudo chown -R tecmint:tecmint ./yay-git
      

      or just

      $ sudo chown -R tecmint:tecmint yay-git
      
      Reply
  7. DO NOT use sudo with yay. Pacman will prompt for privileges as needed.

    FYI, yay is in the Manjaro community repo and can be installed with:

    $ sudo pacman -S yay 
    Or
    $ pamac install yay
    
    Reply

Leave a Reply to MarkDubya Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.