Arch Linux Guide

 

This is a distribution that conceptually is very good. The creator - Judd Vinet, really used some great ideas and integrated them into Arch Linux. This is not necessarily for beginnners, although I did not find it that hard at all to install and I would not consider myself an expert by any stretch.

First off all, here are some links to get your started...

Arch Linux homepage
Arch Linux on Distrowatch
Arch Linux Official Install Guide
Arch Linux Unofficial How-To's
Arch Linux Unofficial Faq's.
Distrowatch Interview with Judd Vinet

Read all of those to get an idea on what Arch Linux is all about.

I will add more to this as I use Arch, but for now I am going to offer some tips in conjunction/addition with the docs.

1 - VERY IMPORTANT!!! Make a list of your modules used on the system you are intending to install Arch on. You can accomplish this in many ways, but the easiest is to do an "lsmod" on a currently running linux (either installed on the hard drive or using a live cd such as knoppix). This will tell you the modules that are loaded and what they are called. You likely will not need to use all of them but some will be very important.

Arch Linux Install:

Know your hardware! If you dont follow step #1, you won't be able to use the correct modules which can lead to not being able to use your soundcard, network card or getting graphical mode.

Of course, you will need free space to install this distro just like any other. Arch can install in a very small amount of space if you like since you are the one choosing which packages to install. However, if you add a lot of packages, you may want to make sure you have at least 4gb free for a system. This would be a typical amount just to have a running system with a larger desktop environment and lots of applications installed. If you think you need more space, make more available.

Boot from the Arch cd, press enter at the first prompt and it will boot the kernel. Then at the second prompt, type: /arch/setup. Follow any on screen instructions until you get to where you can choose an install from cd or ftp. If you have an internet connection that is automatic like cable or a dhcp connection through a router, an ftp install might be for you because you will get the most up to date packages. If you are using a dial-up connection like dsl, you might be better off to use the cd which should have the rp-ppp0e package on it which will allow you to configure dial-up.

The next step is to partition your hard drive. This involves knowing how to create a good partition scheme for your system. If you are unsure as to how this works, see the "How to Partition Guide" under the "Linux Setup" section of this website. If you are installing on an empty hard drive and you would rather not spend the time figuring out how to partition and just want to move on with the install, you can select "Auto-partition".

This choice usually gives you /swap, /boot and / (root) and automatically sizes the partitions for you.
If you are going to partition yourself, you need to know how to use "cfdisk". I usually recommend deleting all the partitions listed and recreating the partition table (as long as you dont have any partitions that you need to keep, otherwise leave whichever partitions you are going to keep and just use the free space).

Using cfdisk
Here is a sample of my partition scheme: cfdisk 2.12

Disk Drive: /dev/hda
Size: 120034123776 bytes, 120.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 14593

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
hda1 Primary Linux swap 509.97
hda2 Boot Primary Linux ReiserFS 98.71
hda3 Primary Linux ReiserFS 3997.49
hda4 Primary Linux ReiserFS 115425.36


[Bootable] [ Delete ] [ Help ] [Maximize] [ Print ]
[ Quit ] [ Type ] [ Units ] [ Write ]

Toggle bootable flag of the current partition

*Note, this is after formatting, so where you currently see "ReiserFS" was previously just called "Linux".
Navigating cfdisk:

up and down arrows toggle the partitions
left and right arrows toggle the options at the bottom (Bootable, Delete, Help, etc)
To create a new partition, use the up/down arrows the highlight the free space, select "New", "Primary" (unless you need to use logical for some reason), "Beginning" and then enter in the amount of space you want to use (it's in mb). Then go to type and enter in the type of partition it will be - basically there are two main choices - 82 is linux swap, 83 is linux. These are general selections right now - keep in mind: CFDISK DOES NOT ACTUALLY FORMAT YOUR PARTITIONS, it just creates a partition table. Do the partitions in an order that makes sense such as - "swap", "boot" (if used), "root" and then anything extra like "home" to be mounted later during the install. Repeat the same steps to create the other partitions, when done, toggle one as bootable. As you can see I have my "boot" (hda2) partition as bootable, but if you do not have boot, you might want to make yours where you created your "root". Otherwise, if you have another install on your partition scheme that is already toggled as bootable, you might want to leave it that way. When done, select "write" and type in "yes" when you are sure it is right and then press enter. *Make a note of what partition number you created each on - you will need to know this!

Set filesystem mountpoints:

Select a partition for your swap and root (your choice for the filesystem - I prefer reiser) and then add in any other partitions you created - /home is automatically written there, but if you have a /boot, just erase /home and type in /boot instead. *Make sure you have the corresponding partition numbers to where you are mounting them. Select "done" and it will format those partitions, if you get an error go back and make corrections.

Select Packages

This is totally up to you. If you are doing an ftp install, you can go nuts and install whatever you like as long as you are sure to include the base packages. If you are on dial up and have a full Arch install cd, you might want to install the packages from the cd since it will take a long time to get them through pacman later. Otherwise, if you are using the full cd, it might be better just to get the base and maybe your favorite editor (I prefer nano) so you can edit files later in command line interface.

Install Packages

Just follow the instructions and wait for the packages to install.

Install Kernel

Arch is one the few distributions that allows you to compile your own kernel during the install. If you are familiar with doing this, it is probably a better choice since you can streamline your kernel for your hardware and build in what you want so you don't have to load any modules. If you are not comfortable with compiling your own kernel yet, you can choose the 2.4 or 2.6 kernel which is most common. I would recommend using 2.6 as opposed to 2.4, but it is your choice. Also, you need to decide whether to use a scsi kernel or ide. The ide kernel will still allow you to do scsi emulated cd burning. The scsi kernel is more used for actual scsi hardware support. If you are unsure, the ide kernel is more common.

Configure System

You need to edit some files here. You can choose between vi ro nano as your text editor.
The first file in that list is /etc/rc.conf. There are three main things to edit in here: your timezone (if unsure,leave unchanged), your hostname (use anything you want - all lower case and no spaces is a safe method), and your network configuration - make sure the eth0 line reads eth0="dhcp" if you are using dhcp.
Edit grub or lilo. I prefer to use grub. As long as you haven't manually named a custom kernel something different or need to add in another operating system, you can leave this unchanged.
*This next section is directly from the Official Arch Install Guide which is linked above, it covers the usage of the rest of the configuration files:
/etc/hosts - This is where you stick hostname/ip pairs of other computers on your network. If a hostname isn't part of DNS, you can stick it here. You usually don't need to change anything here, but you might want to add the hostname and hostname + domain of the machine to this file, resolving to the IP of your network interface. If you don't know what you're doing, leave this file alone until you read man hosts. /etc/fstab - Your filesystem settings/mountpoints are stored here. The install program should have created the necessary entries for you, but you should look it over and make sure it's right.
/etc/modprobe.conf - This is for use with 2.6.x kernels only. This tells the kernel which modules it needs to load for system devices. For example, to have the kernel load your Realtek 8139 ethernet module when it starts the network, use this line:

alias eth0 8139too
/etc/modules.conf - This is for use with 2.4.x kernels only. This tells the kernel which modules it needs to load for system devices. For example, to have the kernel load your Realtek 8139 ethernet module when it starts the network, use this line:

alias eth0 8139too
/etc/resolv.conf - Use this file to setup your nameserver(s) (elg note - otherwise known as your dns numbers - some isp's will provide these for you - enter these here) that you will use. It should look something like this:

search domain.tld
nameserver 192.168.0.1
nameserver 192.168.0.2

Replace domain.tld and the ip addresses with your settings. The so called search domain specifies the default domain to append to unqualified hostnames automatically. That way a ''ping myhost'' will become a ''ping myhost.domain.tld'' with the above values. These settings usually aren't mighty important, though, and most people should leave them alone for now. If you use DHCP, this file will be fed the correct values automatically on bootup, so that you can and should happily ignore this file altogether.

Ok, that's it for that section - a quick note on your modprobe.conf or modules.conf though - you will need to add soundcard support for this as well. This can be done later on or you can enter in your information if you know what it is. If you want to check ahead of time and use ALSA, you can visit the alsa homepage and look under soundcards and select your correct module. For example, if you are using a soundblaster live with the emu10k1 module, you will need to copy and paste this section from your Alsa page search results:

# ALSA portion
alias char-major-116 snd
alias snd-card-0 snd-emu10k1
# module options should go here

# OSS/Free portion
alias char-major-14 soundcore
alias sound-slot-0 snd-card-0

# card #1
alias sound-service-0-0 snd-mixer-oss
alias sound-service-0-1 snd-seq-oss
alias sound-service-0-3 snd-pcm-oss
alias sound-service-0-8 snd-seq-oss
alias sound-service-0-12 snd-pcm-oss

The next step is to install a bootloader. My preference is definitely for Grub, but its your choice. If you do not need to install a bootloader at all, skip this step. If you need a bootloader, select "Install Bootloader" and then pick the one you want to use. At the main menu, select "Exit Installation" and then type reboot as instructed. Hopefully everything boots fine and you can begin the post configuration.
After rebooting check to see if your internet connection is working by typing "ifconfig" - you should see eth0 and lo if you are using cable or dhcp. If you don't, try modprobing your network card (modprobe nicmodule). Then try ifconfig again, if it still isn't working, check your /etc/rc.conf file to make sure it is correct (ie, for dhcp eth0="dhcp") Then try to start the network again: /etc/rc.d/network start. If it starts, try "ifconfig" again. If you are using dsl and have installed the rp-ppp0e package, type "adsl-setup" and go through your setup. You can add in "adsl" to your /etc/rc.conf modules section as well so it loads on boot.


Running "xf86config"

*Make sure the xfree86 package is installed before doing this. Also, I would suggest configuring your root password and adding a user before doing this. Here are the instructions on running xf86config - this is necessary for graphical mode.


Usually the run this, you go into /etc/X11 and then just type xf86config, but sometimes it can be /usr/X11R6/bin/xf86config.
Here are the main things to know when you run it so if you are unsure of something, find out before running it so you don't get stuck.

Mouse Protocol: typically it is IMPS/2 Emulate 3 Buttons - usually yes Mouse Device - /dev/input/mice (usb), /dev/psaux or /dev/misc/psaux (ps/2 - note - use /dev/misc/psaux only if /dev/psaux doesn't work)
Keyboard - typical is #3 - Generic 104 key
Choose Country - typical is #1 US English
Variant name - just press enter
XDB Options - typical is n (no)

Monitor section - press enter to begin
Pick option #11 and enter your horizontal range - find this out by searching google or consulting your monitor/computer documentation
Enter Vertical Sync range - same as above - choose your own
Identifier for Monitor - press enter

Look at the Card Database? press y
pick the appropriate number that corresponds to your card.
Examples:
Nvidia = 18
Intel i810 = 5
Generic Voodoo - 4
Voodoo 3 - 557

* Numbers are subject to change with newer versions of xfree, so pick your card by pressing enter to go thru the list.

*If you have an nvidia card, you can install the nvidia drivers and edit this file later - see the "how to install nvidia drivers" page under Linux Help on this guide for more details.

Confirm your selection - if correct, just press enter.
Pick video card memory
examples:
16384 = 16mb
131072 = 128mb
262144 = 256mb

Enter identifier for card - just press enter
Choosing Resolution

I recommend starting with 1024x768 (or less) for all modes to start

so press 1 to change the mode for 8 bit, then pick 1024x678, 800x600, 640-480 (keystrokes where 1 then 432 then n for virtual screen)
eventually, the current setting section should look like this:
"1024x768" "800x600" "640x480" for 8-bit
"1024x768" "800x600" "640x480" for 16-bit
"1024x768" "800x600" "640x480" for 24-bit

once it says that, press 4 to say the modes are ok.

Choose the color depth - I use #5 which is 24 bit (if you are having trouble getting X (gui mode) to start, you can try using 16 bits instead.
Shall I Write to XF86Config? - press y then enter

You should now be able to start X by logging in as user and typing startx.
You can later edit your /home/username/.xinitrc file so that it starts the window manager of your choice.

Here is mine, which starts fluxbox when I type startx:
#!/bin/sh
#
# ~/.xinitrc
#
# Executed by startx (run your window manager from here)
#
exec fluxbox
# exec enlightenment
# exec wmaker
# exec startkde
# exec icewm
# exec blackbox
# exec gnome-session

*If you want to change your default window manager, you put a # symbol in front of the one you are using and take the # symbol away from the one you want to start using instead.

If you want a graphical login manager to start when you boot up your computer, you will need to edit your /etc/inittab file and make sure that you change your runlevel to 5 and then specify the executable of the login manager you want. For example, for kdm:

id:3:initdefault: - changes to id:5:initdefault:
and the other line you need to adjust:
x:5:respawn:/usr/X11R6/bin/xdm -nodaemon - changes to x:5:respawn:/opt/kde/bin/kdm -nodaemon

2 - If you decide to use kde and you install the kdeadmin package, you will need to also install "dosfstools" in order to format a floppy using kfloppy. pacman -S dosfstools will solve that issue.

3 - If you want to use the "locate" command, you will need to make sure you have added root and your user to the "slocate" group in /etc/group or through kuser if you are using kde and prefer graphical mode. You may already see slocate there or you may have to add it. Just make sure the boxes are checked off and then save it and exit. It will be a good idea to run "updatedb" after to update the database. Then you should be able to use the "locate" command.

4 - To add a user to your system, enter this command: "useradd -m -s /bin/bash yourusername" and then you will be able to login with that username

5 - Sync your pacman repositories: you can run "pacman -Sy" which acts like apt-get update does in debian for example.

6 - (Optional) Specify certain packages NOT to upgrade: you can use a text editor with root permissions and open /etc/pacman.conf and scroll to where it says IGNOREPKG and then uncomment it (take out the # in front of it) and then add anything to that line you do not want to upgrade. Good examples are lilo/grub and gcc. (Gcc should not be upgraded if you are compiling a custom kernel because it will likely corrupt it if you try to recompile. You can add a new kernel using the new gcc to compile it though later.)

7 - To upgrade your entire system type: "pacman -Syu" this will sync your database and then upgrade everything on it.

8 - To get sound working for all users, you need to edit your /etc/devfsd file and add the last line seen in this paragraph to the appropriate section:
# Uncomment this if you want permissions to be saved and restored
# Do not do this for pseudo-terminal devices
#REGISTER ^pt[sy] IGNORE
#CREATE ^pt[sy] IGNORE
#CHANGE ^pt[sy] IGNORE
#DELETE ^pt[sy] IGNORE
#REGISTER .* COPY /dev-state/$devname $devpath
#CREATE .* COPY $devpath /dev-state/$devname
#CHANGE .* COPY $devpath /dev-state/$devname
#DELETE .* CFUNCTION GLOBAL unlink /dev-state/$devname
#RESTORE /dev-state
REGISTER sound/.* PERMISSIONS root.users 660
I usually uncomment out some of the other lines as well, but that is up to you.

9 - Install java and get the java plugin working in mozilla: to install java: "pacman -S j2sdk" then you need to manually enter a symlink from the java directory to your mozilla directory. Yours may different slightly but here is my example: "ln -sf /opt/j2sdk/jre/plugin/i386/ns610-gcc32/libjavaplugin_oji.so /opt/mozilla/lib/mozilla-1.?/plugins/"

10 - If you have a usb mouse does not work - make sure you selected /dev/input/mice when you did your xf86config. Apart from that for kde users, if you get kdm to come up but your mouse doesn't work and it is usb, then then module might not be loading. Log in using the keyboard, press "alt-F2" and type "konsole" to get a terminal, then type: "modprobe usb-ohci" and then try to move your mouse. If that doesn't work, try modprobe usb-uhci" and see if that works. You can refer back to your list of modules that worked using the other linux that I mentioned earlier if that does not work. Once you get one that works, then you can add it to your "etc/rc.local" file which will cause it work upon booting without you having to type it in all the time.


11 - If you want to be able to mount your floppy drive as a regular user, you will need to change your floppy line in /etc/fstab to this (your mount directory can vary):
/dev/floppy/0 /mnt/fl auto async,dev,user,suid 0 0

12 - Some of my favorite packages to get with pacman:

If you want to use Fluxbox, I would suggest using the fluxbox-devel package from the unstable repos. You can temporarily comment out the unstable repo from /etc/pacman.conf and then re-sync pacman and then pacman -S fluxbox-devel to get it. Once done, make sure to comment out the unstable repos unless you want that to be used whenever you upgrade your system.
Related add on packages:
*fluxconf - configuration tool for fluxbox
*emelfm - ftp-like file manager

If you want to use Enlightenment, see the Enlightenment page under Linux Help
*enlightenment - a fantastic light window manager
*epplet-base - enlightenment epplets
*emelfm - an ftp like file browser

If you want kde:
*kdebase - main part of the same desktop environment
*kdeutils - includes kfloppy and more
*kdeadmin - includes kuser and more

*ayttm - multiprotocol instant messenger - available in the ELG downloads section
*dosfstools - allows you to format floppies and more
*k3b - for cdburning
*eject - allows you to eject media (cdroms etc.) from gui
*mozilla - web browser
*j2sdk or j2re - java including the plugin (see above for instructions on how to integrate it into mozilla)
*ripperx - for converting wav files from cd's into various formats (mp3, ogg) to the hard drive
*nedit - a light gui editor
*ttf-ms-fonts - micro$oft fonts
*mplayer - a fantastic media player
*mplayer-plugin - plugin for browser
*cups - used for printing
*gqview - a lightweight app for viewing pictures
*gimp - intensive app for photo editing
*flashplugin - used for displaying flash effects on webpages
*unzip - used for decompressing files in the zip format
*zip - used to compress files (create zip files, needed for ark)
*xmule - p2p filesharing app - available in ELG download section
*gtk-gnutella - another p2p app, on the bearshare, limewire and gnutella network.
*codecs - to allow for multiple types of media to play

For a full list of the packages I have installed on my main Arch Linux box, click Here