2019-05-01_Linux_Format

(singke) #1

4446May 201026y978298 May 2019LXF249 49


Arch Linux in-depth


Manjaro’s graphical
package manager
Pamac can be
yours, and so can
GNOME’s emoji
selection widget.

systems which had that group installed previously,
unless the user explicitly reinstalls the group. If the
same thing happened with the ‘plasma-meta’
metapackage, the new package would appear. You
can’t pick and choose individual packages from a
metapackage, so they are in this sense less flexible;
however the way they’re used to package the KDE
application suite is particularly nice.
KDE applications are divided into categories (see
https://kde.org/applications), and in Arch each
category has its own metapackage, such as
kdegraphics-meta and kdeedu-meta. Since the kde-
applications-meta package depends on all of these
metapackages, we can get away with calling them
submetapackages. Nomenclature aside, they provide a
neatwaytoensureyourKDEinstallhasthelatestapps.


AnunmistakableAura
Besides minimalism, bleeding-edge packages and
street cred, one of the main draws to Arch is the AUR
(Arch User Repository). Here you can find community-
provided packages for software that for one reason or
another hasn’t made it into the official repos. This might
be because of licensing reasons: Spotify and Google
Chrome can’t be redistributed, for instance, but having
a ‘source’ package that downloads the official binaries
and packages them locally is fine. Or there might be
complexities running them in certain situations:
Canonical’s Snap packaging system, for instance.
It’s also a staging ground for packages that one day
might make it into the official repos, and users can vote
in order to influence this. In order to use the AUR, we’ll
need the base-devel package group, which includes
compilers, configurators, parsers and all the helper
utilities required to build from source. Once we’ve got
that, all that’s required is to download the relevant
PKGBUILD (a text file that describes an Arch Linux
package) from the AUR, and use Pacman’s makepkg
utility to bundle it into a package that can be installed
with pacman -U mypackage-x86_64.pkg.tar.xz.
This seems fairly straightforward, but unfortunately
the process can become quite laborious. For one thing
the makepkg command on its own won’t install
dependencies automatically. Fair enough; just add the
-s switch. Problem solved... except that AUR packages
can depend on other AUR packages, which makepkg
won’t help you with. So we’ll show you how to set up
one of many AUR helpers. For a long time Yaourt (Yet
AnOther User Repository Tool) was the utility of choice
here. It was great, mostly because it had the same
syntax as Pacman and so could be used as a drop-in


replacement. You can still use this if you want, but it’s
unmaintained, has security issues, and there are plenty
of alternatives.
ArchLabs used to use PacAUR, but has now
switched to its own helper, Baph. The Arch Wiki has a
whole page dedicated to AUR helpers (https://wiki.
archlinux.org/index.php/AUR_helpers), with a
comprehensive list of their features. Here you’ll also
learn that no AUR helper is officially supported by Arch,
so you’ll need to install one the manual way, by
downloading PKGBUILD files and so forth. We’ll cover
setting up PikAur (https://github.com/actionless/
pikaur), which is written in Python, has minimal
dependencies and like Yaourt before it, uses Pacman
syntax for ease of use. The best way to install PikAUR
is by using Git, and then makepkg to make a package
suitableforPacmantodigest.We’llstartbyinstalling

thebase-develgroupandGititself:
# pacman -S --needed base-devel git
The --needed switch won’t reinstall them if they’re
already there. Now we’ll go ahead and clone the pikaur
repo, which you can do as a regular user:
$ git clone https://aur.archlinux.org/pikaur.git
Then we can dive in and make the package (also as a
regular user):
$ cd pikaur
$ makepkg -fsri
The -f switch overwrites any previous package files
in this directory – useful if you’ve tried to build the
package previously and it has failed. The -s installs any
dependencies, the -r removes any that are no longer
required after the package is built, and the -i installs
the package. These last three options require Sudo to
be installed, since running makepkg itself as root is
not allowed. If you don’t have or don’t want to have
Sudo installed, you can perform those steps manually.
Incidentally pacman-Qdt is a very useful command
for listing dependencies that are no longer needed.
Happy archery!

TheArch userrepOsiTOrY


“Besides minimalism, bleeding-edge


packages and street cred, one of the


main draws to Arch is the AUR”


It may look like regular Firefox, but it’s actually Fedora’s Wayland
edition, available in binary form from the AUR.
Free download pdf