[HowTo] Configure Arch Linux.

When you’ve completed the base install of Arch Linux, there’s not really much to work with. Hell, you haven’t even got a regular user yet (only root). So there’s quite a lot that needs to be done and you’ll need to do it step by step. The biggest advantage is that you get to decide what you want, making your system completely adapted to your liking. Also, you’ll get to know your system much better. And last but not least, it’ll make it fast as hell, or at least, as fast as you want it to be…

This HowTo only covers some basic steps in your system configuration, which I find particularly useful or important. Getting your sound working, configuring pacman, installing and configuring the X-server and a desktop environment… etcetera.
If there’s something “bigger” or more special, like for instance setting up the Openbox window manager, I might write a separate HowTo on it later.

Since I’m kind of an “Arch noob” myself, it might not be 100% complete. I’ll try and make sure that it is updated whenever I find more information, or easier/better ways to set something up.
In what’s described below, I only mention what I did to get my system the way I like it to be. So in essence, it’s completely written for my personal (re-)use. If you want to configure your Arch Linux system, please take a look at the official documentation on the Arch Wiki first. If its to any use to you (who knows, it might), you can use this HowTo as well. However, I’m not to be held responsible if you’ve completely fucked up your system while doing so (insert-evil-smiley-here).

 


 

1. User Management.

First of all, create your regular user right away. To do so, invoke these commands:

# useradd -m -s /bin/bash USERNAME
# passwd USERNAME

Then, add your user to some important groups, audio e.g. to be able to play your music, storage and optical e.g. for enabling your user to burn DVD’s.

# gpasswd -a USERNAME audio
# gpasswd -a USERNAME storage
# gpasswd -a USERNAME optical

Log out as root and log back in as your user. You can use ’su’ if you need root access later.

 

2. Mounting Other Partitions.

The /etc/fstab file contains all the partitions on the hard drives of your computer that will be mounted at boot-up. If you have other partitions, with data or even other operating systems, you’ll want to include them in this file.

If you’re not sure what kind of partitions you have on your system, use the command ‘fdisk -l’, it will list them for you.

I have a FAT32 partition (from back in the day when I still used Windows) with all my important data on it, like my music, films, school stuff, etcetera. The fstab line looks like this:

/dev/sdb5 /mnt/Data vfat rw,user,umask=0000 0 0

My second data partition is formatted with the Ext3 filesystem. This is the fstab line:

/dev/sda2 /mnt/Data2 ext3 defaults 0 1

If you have Windows installed on another partition (most probably with the ntfs filesystem) you can add a line that looks similar to this:

/dev/sdXx /mnt/Windows ntfs ro,user,umask=0222 0 0

Note: This will only give you read access to the ntfs partition. If you want to be able to write to it as well, you can with the ‘ntfs-3g‘ driver, but I have no experience with that. And hopefully, I never will.

 

3. Wired Networking.

If you didn’t configure your network during the installation, now’s the time to do so.

In /etc/rc.conf
Choose a decent hostname for the computer, e.g. VitoCorleone.

If you use a static ip address, the networking section of your /etc/rc.conf should look similar to this:

lo="lo 127.0.0.1"
eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
INTERFACES=(lo eth0)
gateway="default gw 192.168.0.1"
ROUTES=(gateway)

If you use DHCP, it’ll be something like this:

lo=”lo 127.0.0.1”
eth0=”dhcp”
INTERFACES=(lo eth0)
gateway=”default gw 192.168.0.1”
ROUTES=(!gateway)

Note: Don’t forget the ! In the ROUTES line.

In /etc/resolv.conf
If you use DHCP, you won’t have to edit anything here, dhcpcd will automatically do that for you. However, if you use a static network, you most probably will need to add your domain and name servers here.

In /etc/hosts
I’ve set up a “mini Lan” with my server, laptop and desktop. To make things easier (e.g. when ssh’ing from one machine to another), I’ve added all the IP addresses and their corresponding hostnames to this file. In my case, it looks like this on my desktop:

127.0.0.1 localhost.localdomain localhost
192.168.0.1 Clemenza.kotnet.org Clemenza
192.168.0.2 VitoCorleone.kotnet.org VitoCorleone
192.168.0.3 LucaBrasi.kotnet.org LucaBrasi

My server, Clemenza, has two network interfaces, one that connects with DHCP to the internet, and the other one (192.168.0.1) forwards it to the static LAN.

When you’re done setting up, restart the network

# /etc/rc.d/network restart

and see if everything works the way it should.

 

4. Configuring the Pacman repositories.

The Pacman package manager is the main application with which you will install and update packages. You can compare it to Debian’s APT or Fedora’s Yum. However, before being able to use it properly, you’ll need to edit the /etc/pacman.conf file, to enable the repositories you want to use.

In Arch Linux, you can use roughly five different kinds of repositories; current, extra, community, testing and unstable. I only use current, extra and community on my desktop. If you don’t mind a little bug/hiccup now and then, you can use testing as well. It has even newer software, but sometimes that can cause some problems (I use it on my laptop, with no problems so far).

In the REPOSITORIES section, remove the #’s at every repository you want to use. On my desktop, it looks like this:

#[testing]
#Include = /etc/pacman.d/testing
[current]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/current
[extra]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/extra
#[unstable]
# Add your preferred servers here, they will be used first
#Include = /etc/pacman.d/unstable
[community]
# Add your preferred servers here, they will be used first
Include = /etc/pacman.d/community

With Pacman3 (which is included in the Duke release), it uses ranked mirrors. In /etc/pacman.d/ there is a file for each different kind of repository, in which you can order the different pacman mirrors available. I live in Belgium, so I put the Belnet mirrors at the top of each of those files (followed by the Dutch mirrors, the French mirrors, etcetera). Whenever pacman needs to download files, it will always try to get them from the mirror that is listed first in those files.

To improve Pacman’s speed even more, run the ‘pacman-optimize’ command.

When you’re done with all of this, I suggest you immediately use Pacman to update your system:

# pacman -Syu

Now guess where you can find more information about Pacman and the different commands? Oh yes. It’s the Arch Wiki!

 

5. Configuring Xorg and Nvidia.

Setting up your X server is depends highly on what monitor and video card you have. If you read through the guidelines on the Arch Wiki, you shouldn’t run into a lot of problems. Here’s how I did it:

I have an Nvidia graphics card so evidently I installed the Nvidia drivers. People with an Ati card can take a look here.

Install the Xorg package:

# pacman -S xorg

Install the Nvidia drivers:

# pacman -S nvidia (for newer cards)
or
# pacman -S nvidia-71xx (for older 'legacy' cards)

Let the Nvidia driver configure X:

# nvidia-xconfig

Although the nvidia driver managed to get my X working almost perfectly, I did have to add/change some things to the Xorg configuration file, which is /etc/X11/xorg.conf. The keyboard needed to be set to the Belgian layout, and since I use two screens I had to set up TwinView. For safekeeping, and future reference, I’ve uploaded my xorg.conf here (single) and here (dual).

You can test your X server with the ‘startx‘ command, but you probably wont be too impressed, as you haven’t got a window manager installed. We’ll get onto that in the next section.

 

6. Installing and configuring Gnome.

Having an X server running without a desktop environment, or at least a decent window manager like e.g. Openbox, isn’t really much of anything. On my desktop I prefer to use Gnome as a desktop environment. There are many excellent alternatives available, like KDE, Xfce or window managers like Openbox, IceWM, FVWM,… If you’re relatively new to Linux I’d suggest using either Gnome, KDE or Xfce.

Installing Gnome is pretty easy, just run these commands:

# pacman -S gnome
# pacman -S gnome-extras

One of the most brilliant things about Arch is that it will now allow you to select which extra parts of Gnome you wish to install (e.g. Totem, file-roller, eog, Rhythmbox,…). It’s the first distro I encountered that let’s you do that. Usually it just installs all of it, leaving you with no option whatsoever.
Anyway, just pick the ones you want. If you’re not sure to include something or not, remember that you can easily uninstall it later.

You can start Gnome in three different ways:
a. execute ‘gnome-session’
b. start Gnome automatically when X starts, by adding ‘exec gnome-session’ to your /home/username/.xinitrc file (and making sure it’s the only line with ‘exec …’).
c. use a graphical loginmanager like GDM.

The latter is (imho) the easiest way, and it will also make X start automatically at boot-up.
You can install GDM with:

# pacman -S gdm

Finally, to get everything running smoothly, you’ll need to edit your /etc/rc.conf again.
Add ‘portmap’, ‘fam’, ‘dbus’, ‘hal’ and ‘gdm’ to the DAEMONS line.

 

7. Sound.

To get sound working on my system I had to install the utilities of the alsa-driver.

pacman -S alsa-oss alsa-lib alsa-utils

Afterwards run ‘alsaconf’ to run the alsa setup program (which will detect your sound card and get the necessary modules working). This will also edit your /etc/modprobe.conf file automatically, so just to be sure, make sure it’s uncommented it in your /etc/mkinitcpio.conf.

If you haven’t done it already, add your user to the audio group.

# gpasswd -a USERNAME audio

Finally, edit your /etc/rc.conf again, to get it all working when rebooting. Add ‘alsa’ to the list of DAEMONS.

You should be able to play music files now with e.g. Rhythmbox.

 

8. Fonts.

When installing X and a desktop environment you already have a basic set of fonts. However, some web pages or documents might still look pretty ugly (often because you haven’t got those silly MS fonts).

I installed a whole bunch of fonts, just to make sure everything is displayed as it should.

# pacman -S font-bh-ttf ttf-cheapskate ttf-isabella ttf-junicode ttf-ms-fonts ttf-dejavu ttf-mph-2b-damase artwiz-fonts terminus-font font-bitstream-speedo gsfonts ttf-bitstream-vera xf86bigfontproto xorg-fonts-100dpi xorg-fonts-75dpi xorg-fonts-alias xorg-fonts-encodings xorg-fonts-misc xorg-fonts-type1 ftgl font-mathematica ttf-freefont

 

9. Printing.

I have an HP 845c usb printer, and evidently I use CUPS to handle my printing. You can find a more detailed howto on printing on the Arch Wiki. Anyway, here’s how I managed to get it working:

First, install the necessary stuff:

# pacman -S cups ghostscript gutenprint hplip

hplip contains the HP drivers, gutenprint are other drivers that also work. Usually hplip should be sufficient, but I wanted to see if there were any major differences between the two, so I got both.

Start it up:
If you use the default Arch kernel (which I still do) you need the usblp module to load. If you already managed to get your own kernel working, you’ll need the usbcore module.
You can manually load them with:

# modprobe usblp
or
#modprobe usbcore

To auto-load them at boot time, add one of them to the MODULES line in your /etc/rc.conf.

Secondly, if you’ll need to start the cups deamon, you can start it manually with:

# /etc/rc.d/cups start

Or you can add it to the DAEMONS line in your /etc/rc.conf to get it to start automatically at boot time.

There are different ways to configure CUPS. The easiest way is (imho) to just use the web interface thingy. Gnome users can also install gnome-cups-manager, KDE users can use the Control Center. But I just find the web interface more easy and universal.

To open it go to http://localhost:631/ in your web browser, and start with adding your printer there. It’s pretty straightforward.

When it asked for a user and password, I filled in root + my root password. Which seemed to do the trick.

 


 

That’s about it for now. With your system running X and Gnome (or something else), you should be ready to discover Linux even further. Explore the Arch Linux Wiki and Forums, install your favourite applications, try out new things, and most importantly … Enjoy !

 

 

Update: Added Printing. (13-06-2007)

 

2 Responses to “[HowTo] Configure Arch Linux.”


  1. 1 Harvey October 25, 2007 at 00:42

    I thought I’d give Arch a go, thanks for the help Well written, a lot of help, hope I can get it all working OK.

  2. 2 freduardo October 25, 2007 at 13:05

    Thanks for the feedback.

    I’m planning to add an Openbox , an Xfce and maybe a wireless section (’rt61′ in my case) to this. I just need to find the time to get it done.

    Good luck with Arch, hope you’ll like it just as much as I do ;)
    And if you run into any problems (let’s hope not), the Arch Wiki and Forums should be really helpful.


Leave a Reply




~/Screenshots/Recent/

 

~/Copyleft/

The content of this blog is licensed under the GNU Free Documentation License. More information, and a copy of the license, can be found on the About page.

~/Contact/

freduardo[at]gmail[dot]com

~/Archives/