AUR Quickstart
From ArchWiki
Contents |
Introduction
This page shall give a quick and easy introduction to the Arch User Repository (AUR) for users. If you want to submit a package to AUR please check AUR User Guidelines and Arch Packaging Standards
What is the AUR?
The AUR is a place for users to upload their PKGBUILD's so others can use them. A PKGBUILD contains packaging and build instructions for makepkg to use. makepkg itself is a script that executes a number of tools to but we will get to that later.
All packages get build from source.
What is the AUR not?
The AUR does not provide binaries. It is not a place for users to upload their compiled binaries.
USER BEWARE
PKGBUILD's are basically bash scripts that contain some functions for makepkg. It's perfectly possible for a PKGBUILD to contain major headaches in form of malicious commands (rm -rf /* anyone?) and whatnotelse. Be strongly advised to edit every PKGBUILD you want to use before running makepkg to rule out its doing something that you don't want it to do. Since makepkg uses fakeroot there is some kind of protection but you shouldnt count on it.
First Steps
The AUR is reachable through the webinterface under http://aur.archlinux.org Once there you will find a search box (to search the AUR obviously). Enter what you think you need and you will be presented with the results. Its either a list or a package with that name so in case its a list click the package that is interesting to you.
Once there you will see a summary. Homepage, description, votes and so on. A little further down are 3 clickable link
Tarball::Files::PKGBUILD
What you want is the Tarball. download it. It does not contain the source for the package but it contains the PKGBUILD plus (maybe) some additional stuff like needed patches, missing .desktop files, post-build scripts or a picture of the maintainers kitten.
What now?
After you downloaded the tarball which is typically named after the package (e.g. slurpy-git.tar.gz) you extract it typically to a build folder (~/build/ for example) but that your choice. To extract the package.tar.gz use:
tar xvfz <package.tar.gz>
A new folder gets created in the process named after the package (again), here some sample output:
tar: Record size = 6 blocks slurpy-git slurpy-git/PKGBUILD
now change into the created directory.
cd <folder-that-wasnt-here-before>
Once you are in there you will find at least a file called PKGBUILD. That makes what makepkg wants. All thats left to do is to check the PKGBUILD and type makepkg. much like this:
makepkg
and the building of the package should start. You might miss some dependencies. In that case use makepkg -s which will try to resolve that for you. Ensure you get yourself familliar with the output of makepkg -h at some point.
It worked! what now?
Lucky you. The folder once almost empty now contains a lot more. The interesting part is the <package>.pkg.tar.gz file. This is your package! Install it!
pacman -U <package>.pkg.tar.gz
Enjoy.