Git and the AUR

For lovers and users of Arch Linux, I’ve found this incredibly useful trick to make installing and maintaining packages from the Arch User Repository (AUR) much simpler! If you have a package manager installed that handles packages in the AUR, then you may not need this, but I like to have as much control as possible over my system.

First off, edit your ~/.gitconfig file, and add the following to the file:

[url "https://aur.archlinux.org/"]
    insteadOf = aur:

That’s the trickiest part of the whole thing! I have a folder in my home directory named “aur” for any packages I’ve installed from the AUR, but you could obviously have this anywhere on your system that you like, if you choose to keep these at all.

So all I have to do to install something (in this case, dbeaver) from the AUR is the following:

cd ~/aur
git clone aur:dbeaver
cd dbeaver/
makepkg -sri

And if I already have dbeaver (or whatever package) installed, but I know there’s a new version in the AUR, then I just have to run the following to update it!

cd ~/aur/dbeaver/
git pull
makepkg -sri