Tuesday, July 17, 2007

Archlinux setup tutorial

Today I am going to write a quick tutorial on installing and getting a working system using Archlinux. I believe that this is one of the best distributions available, if you are willing to work and start learning something about the fascinating Linux world. As a Slackware user for almost 5 years, I recently switched to Arch because I think that it has some very interesting features that lack in Slack, such as a great package manager and platform specific compiling (it is built for the i686 platform). You get all the nifty features like bleeding-edge packages and standard 2.6 kernel (hehe slack) but you still control the operating system. So, without further ado, let us begin.

Getting the ISOs

I just grabed a copy from my local mirror and burned it on a CD. I only got the base system iso as it is faster to download and I always get packages through pacman. Leave the CD in the tray and reboot your system. Following the instructions on the screen you should get a command prompt:

[Arch Linux: /]#


I have my hdd already partitioned and I won't get into technical stuff such as partitioning your drive. You get fdisk and cfdisk for that and there are plenty of tutorials available on google for such. Anyway, here is my hdd layout:

/dev/sda5 - / - 10GB
/dev/sda6 - /boot - 1GB
/dev/sda7 - swap - 3GB (I know that it's not necessary to have such a big partition for swap but I also use my box as a server)
/dev/sda8 - /usr - 15GB
/dev/sda9 - /home - 15GB (you will download por.... ahem ... pro... grams won't you :) )

Basic setup

Okay. At the prompt just type in /arch/setup and you should be welcomed by a dialog based installation program.

1. You are prompted to choose your installation media. I usually (I mean always) go for option 1 - CD-ROM or OTHER SOURCE

2. Prepare hard drive

  • I only go for option 3 and assign mount points to my partitions. I choose ext3 for my filesystem although I believe that xfs is better than ext3 (bad habits die hard).
  • Be careful that you first have to choose your swap partition.
3. Select packages. As I only downloaded the base ISO, guess how many options I have:)
4. Install packages - pretty straightforward. I do not choose to keep the packages in cache as I won't have any further use for them.
5. Configure system - use nano or vi to your liking (I recommend nano if you want just easy editing)
  • Use hwdetect
  • No booting from usb devices (at least in my case)
  • No fireware
  • No pcmcia devices
  • No nfs shares
  • No software raid arrays
  • No lv2m
  • No encrypted volumes
  • No custom DSDT files
  • /etc/rc.conf - this is your general config file so be careful what you write in it
  1. Timezone - i change mine to Europe/Bucharest
  2. MOD_BLACKLIST=(nvidiafb) - I add this since nvidiaframe buffer gives me an error while trying yo compile my nvidia graphic card
  3. HOSTNAME="something"
  4. Modify eth0="eth0 ip_address netmask subnet_address broadcast broadcast_address"
  5. Modify gateway with your default gateway and be sure to delete the preceding ! on ROUTES=(!gateway) as this disables the gateway (nasty)
  • hosts - add your host that you put in the HOSTNAME variable in /etc/rc.conf (above)
  • /etc/resolv.conf - add your nameservers or you can just opendns
  • locale-gen - uncomment the line with en_US.UTF-8
  • Set the root password
  • Choose the mirror closest to you
6. Install the kernel - you only have one option here too
7. GRUB is okay for me - but I have to uncomment the Windows lines :-S... sorry guys ... hem... not me :)

Now go ahead and reboot. All should be fine.

Adding a user

Just type adduser at the command prompt and follow the instructions on the screen. Please be advised that I use a sudo environment and as such, a good password for the username is necessary.

Upgrading the system

just run pacman -Syu at the command prompt. It will take a while (not that much really because there aren't so many packages installed yet).

Sudo environment

As I believe that the Ubuntu philosophy regarding using sudo is very good, on all my systems I get sudo up and running. Here is how:

pacman -S sudo
Run visudo after that and just below root ALL=(ALL) ALL add user ALL=(ALL) ALL. Be careful please as this implies that the specified user will have all the privileges root has.

Xorg setup

It is as simple as

sudo pacman -S xorg

After that all you need to do is generate an /etc/X11/xorg.conf. I like the nvidia setup tool for Xorg so let's go ahead and install some proprietary drivers.

sudo pacman -S nvidia
sudo nvidia-xconfig
cp /etc/skel/.xinitrc ~

Now let's edit the xinitrc file and delete the comment before exec startkde (as we will be using kde).


Kdemod is a modular and patched version of KDE for Archlinux. It's really great. All you need to do is to edit the pacman file:

sudo vi /etc/pacman.conf
Add at the end
Server = http://kdemod.ath.cx/repo/current/i686
sudo pacman -Syu
to get the list for the kdemod repository
sudo pacman -S kdemod - go get a cup of coffee or something as this surely takes a while
sudo pacman -S kdemod-kdebase-kickoff
sudo pacman -S kdemod-kdebindings
sudo pacman -Rd libbeagle
sudo pacman -S kdemod-kerry
sudo pacman -S kdemod-beagle
sudo pacman -S kdemod-applets kdemod-tools
sudo pacman -S kdemod-kdeutils-kcalc kdemod-kdeadmin
sudo /opt/kde/bin/apply_kdemod_theme

Accessing your NTFS partition

Okay guys I'm guilty. I do have some ntfs partitions on my desktop. Here is how to access them:

sudo pacman -S ntfs-3g
sudo modprobe fuse
Add fuse to your /etc/rc.conf MODULES part
Edit your /etc/fstab file
Add the line:
/dev/sda1 /mnt/sda1 ntfs-3g defaults 0 0
And then let's remount all the drives (but be sure to create /mnt/sda1 first)
You now have read-write access to your ntfs drives.

Let's listen to some music

sudo pacman -S alsa-utils alsa-lib alsa-oss
sudo alsaconf
sudo alsamixer
sudo alsactl store
gpasswd -a user audio

Also be sure to add alsa to the DAEMONS line in /etc/rc.conf (you have to edit it as root).

Tips and tricks

  • Let users use usb sticks
gpasswd -a user storage
gpasswd -a user optical
  • Settings for firefox:
Proportional: Serif 16
Serif: Times New Roman
Sans: Arial
Monospace: Courier New 13
Minimum font size: 13
  • Settings for KDE
Go to Control Center. Replace color with cleanstick-black-font (you can find it on kde-look.org). Replace style and Window Decorations with Plastik.

  • Add hal to DAEMONS in /etc/rc.conf

Software ( great stuff to install )

sudo pacman -S firefox
sudo pacman -S ttf-msfonts ttf-cheapskate artwiz-fonts
sudo pacman -S amarok-base
sudo pacman -S rtorrent
sudo pacman -S acroread
sudo pacman -S jre
sudo pacman -S openoffice-base
sudo pacman -S screen
sudo pacman -S smplayer
sudo pacman -S flashplugin
sudo pacman -S pidgin

Well that's about it for tonight. Tomorrow we take a look at some of the config files for different programs. Yes I admit most of this stuff you could find on the Archlinux Wiki but I thought that bringing all of these together combined with my own experience of using Archlinux could be somewhat interesting.


Cătălin Stoian said...

Frumos. So this is for the lazy guys who fail to read the arch wiki :-) Ah, și ca să adaug ceva (ca să ma aflu și eu în treabă, nu de alta) ar fi de preferat ca alsa să fie pus să pornească la startup, modificând secțiunea DAEMONS din /etc/rc.conf. Am în cap de ceva vreme să traduc documentația oficială Arch Linux în română (install guide-ul ăla), dar singur nu cred că o să mă apuc, eventual cu ceva ajutoare. Dacă ai vrea să ajuți, lasă un comment sau ceva. Ciao ! ;)

Anonymous said...

Great! Thanks!