Mastering Arch Linux

I have written an in-depth tutorial on installing Arch Linux, but, like any operating system, there are a lot of things that can be done after the install to make your system more usable. (Hat tip to Alexander Diana, a member of the Arch Linux community, for his contributions to this story.)

Dell/Thinkstock

1. Keep your system updated

The main idea behind using Arch is to have an always updated system. After all, it’s a rolling release distribution. But Arch won’t update itself so you will have to do it.

Just keep in mind that there is the potential that things will break. Unlike many other distros, Arch doesn’t patch anything and pulls everything from upstream. My advice: keep an eye on the Arch Linux mailing list so that you are aware of potential problems.

With that caveat, let’s update Arch. First, become root.

# su -

(If you have installed sudo, then you can perform these tasks as sudo user.)

Always refresh repositories and update packages before installing any new packages to avoid dependency issues. I suggest getting into the habit of running updates every day. The more frequently you update the distro, the lower your chances of breaking the system. Small updates also allows to you to better troubleshoot if something does go wrong, as you do know what packages you updated.

To refresh repositories and update packages, run this command:

# pacman -Syu

Dell/Thinkstock

2. Manage repositories

By default Arch Linux enables ‘stable’ repositories only, but if you are adventurous you may want early access to the latest packages.

First, open repo file:

$ nano /etc/pacman.conf

Here you can uncomment [testing] and [testing-community] repositories that will allow you to install packages that are in testing stage. This includes early access to newer versions of desktop environments (one reason why I use testing). Because it's 'testing,' you should be prepared for things to break, but in the past 6 months, the only thing that broke for me was that the Dropbox client had some bugs. I never encountered a system crash or broken system despite using ‘testing’ repos. But, don’t use it if you are not prepared to fix things.

Dell/Thinkstock

3. Install apps

There are two kinds of apps in Arch: packaged apps that are available through official repositories and apps that you install using AUR (more about this on the next slide). To install apps through official repositories, first refresh the repositories:

pacman -Sy

Then install the app:

pacman -S app_name

Example:

pacman -S vlc

To remove packages, use ‘R’ instead of S:

pacman -R vlc

Dell/Thinkstock

4. Install AUR packages manually

AUR (Arch User Repository) is similar to openSUSE OBS and Ubuntu’s PPA in the sense that it’s purely user-driven. But unlike OBS and PPA, AUR doesn’t host pre-packaged packages. Essentially, AUR packages contain build instructions for compiling and installing packages. But don't be intimidated, it’s very easy to compile and install packages from AUR. There are two ways to do it: use a tool like yaourt or do it manually.

Let’s talk about manual process as that’s where all the fun is. You can search for the desired package in AUR, let’s say, Google Chrome. I found three packages here. (I chose the stable version.) And download the snapshot of PKGBUILD (the file that contains build instructions).

Now change directory to where the tarball of PKGBUILD was downloaded and extract it with this command:

tar -xvf name_of_package.tar.gz

In my case it was

tar -xvf google-chrome.tar.gz

Once the content is extracted, cd into the content folder:

cd google-chrome/

And now run the following command that will compile, package and install it. You won’t have to do anything but provide it with password, if needed, and confirm installation of dependencies:

makepkg -sri

The package is compiled and installed.

Dell/Thinkstock

5. Use yaourt to install AUR packages

If you think manual installation of packages is hard, then you can install yaourt. Yaourt needs ‘package query,’ so let’s install it first. If you don’t have ‘git’ installed, first install it.

sudo pacman -S git

Now clone the package query on your system:

git clone https://aur.archlinux.org/package-query.git

Now ‘cd’ into the directory:

cd package-query

And then compile and install the package:

makepkg -si

Now it’s time to install yaourt. First get out of package query directory:

cd ..

And now clone the repository:

git clone https://aur.archlinux.org/yaourt.git

Then ‘cd’ into this directory:

cd yaourt

And now compile it:

makepkg -sri

Now to install any package using Yaourt:

yaourt package_name

Yaourt will show you the available packages. To install one of them, just type the number. Yaourt will also show packages that are available in official repos in addition to AUR. So you can use it as the default tool for app installation.

Dell/Thinkstock

6. Install some much-needed apps

You will get a set of apps, depending on the desktop environment you installed on the system. I routinely install the following apps: Firefox, Chrome, Tomahawk, vlc, Dropbox and LibreOffice. Now you know the drill, so you can easily install any app that you need.

That’s most of what I do after installing Arch Linux, if you have any questions, ask in the comments below.