# How to Install Apps from AUR

**URL:** <https://forum.endeavouros.com/t/how-to-install-apps-from-aur/16233>\
**Category:** Newbie\
**Created:** [July 30, 2021, 7:33am UTC](https://forum.endeavouros.com/t/how-to-install-apps-from-aur/16233 "2021-07-30T07:33:28Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Kresimir](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/kresimir/32/73739_2.png) [@Kresimir](https://forum.endeavouros.com/u/Kresimir)\
**Post date:** [July 30, 2021, 8:20am UTC](https://forum.endeavouros.com/t/how-to-install-apps-from-aur/16233/6 "2021-07-30T08:20:29Z")

</div>

`makepkg` is a script that creates a foreign (i.e. non-repo) package, which can be installed using `pacman -U`.

Before we can make a package, we need to have both `base-devel` and `git` packages installed:

```auto
sudo pacman -S base-devel git --needed

```

On EndeavourOS, these should already be preinstalled.

Depending on the specific package, we may also need other programs, like compilers and build systems. These are called “make dependencies”.

Typically, making a package from the AUR involves the following steps:

1. Find the package on [aur.archlinux.org/packages](http://aur.archlinux.org/packages)
2. Find the “Git Clone URL” for the package.
3. Download everything needed to build the package (“clone”) using the `git clone` command.
4. `cd` into the directory where everything downloaded, including the PKGBUILD file.
5. Open the PKGBUILD file in a text editor and inspect it for anything suspicious (see my [tips on what to look out for](https://forum.endeavouros.com/t/aur-pkgbuilds/6669/18))
6. Run `makepkg -si` inside the directory where the PKGBUILD file is.

In the `makepkg` command, the option `-s` means “automatically install dependencies (including installing make dependencies – programs needed to build the program you’re packaging)”, and `-i` means “if package is built successfully, install it”. If you don’t provide the `-i` option, `makepkg` will only create the package, which you can install later manually using `pacman -U` command.

Here is a concrete example:

On vanilla Arch, you don’t get the program `yay` preinstalled, and it is not available in the official repos (so `sudo pacman -S yay` will not work). This is probably intentional to force you to go through the above process at least once in your life. So you would do the following:

1. Find the AUR page for `yay`, this is it: [https://aur.archlinux.org/packages/yay/](https://aur.archlinux.org/packages/yay/)
2. Look under “Git Clone URL” and you’ll see it says this:  
`https://aur.archlinux.org/yay.git `  
Take this opportunity to look at the package popularity, the names of the maintainer and the last packager, date when it was last updated, etc… and also to read the comments if there is anything unusual you should pay attention to. Clearly, `yay` is a very popular AUR package!
3. Run the following command:

```auto
git clone https://aur.archlinux.org/yay.git 

```

4. Notice that a directory named `yay` has been created. `cd` into it:

```auto
cd yay

```

5. Notice that there is a PKGBUILD file inside. We can quickly glance through it using the `less` command:

```auto
less PKGBUILD

```

Looks like a normal PKGBUILD to me1 🕶, nothing malicious in there, so we’re good to go (hit Q to exit `less`).
6. Run:

```auto
makepkg -si

```

A make dependency for `yay` is `go` (the compiler for the Go language). Unless you already have it installed, `pacman` will be launched and prompt you to install it from the repos (asking you for your `sudo` password). After you do so, the building of the package `yay` will commence. Give it some time… When the package is built, `pacman` will be launched again to install it. And there you go, now you have `yay` installed (assuming there were no errors).

Of course, when it comes to `yay` on EndeavourOS specifically, you don’t have to do this, because the `yay` package happens to be in the `endeavouros` repo, for our convenience. So we can just `sudo pacman -S yay` (we don’t even need to do this, because EndeavourOS comes with `yay` preinstalled).

This whole process of building and installing a package from the AUR is what an AUR helper like `yay` does automatically for you (except step 5, but `yay` gives you a convenient way to look at the PKGBUILD file), and it also keeps track of all installed foreign packages, and allows you to update them when they are updated on the AUR. This is why, normally, you should use an AUR helper, because it makes life so much easier. But in order to understand what’s going on, and avoid potential pitfalls, it’s beneficial to know how to do this manually.

With time and experience, you’ll be much more comfortable with all of this.

More reading:

- [https://wiki.archlinux.org/title/Arch\_User\_Repository](https://wiki.archlinux.org/title/Arch_User_Repository)
- [https://wiki.archlinux.org/title/Makepkg](https://wiki.archlinux.org/title/Makepkg)
- `man makepkg`

To learn how to use `yay` to automate this process:

- `man yay`

Though you should at least look up at the package on [aur.archlinux.org](http://aur.archlinux.org), regardless.

Good luck!

* * *

1 Famous last words…

---

_[View the full topic](https://forum.endeavouros.com/t/how-to-install-apps-from-aur/16233)._
