Newcomers Guide

From ArchWiki
Revision as of 14:02, 21 January 2007 by Freigeist (Talk | contribs) (Arch Linux Beginners Guide)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Installing and configuring Arch Linux


Preface

This documentation will guide you through the whole process of installing and configuring Arch Linux. It is based on the current Voodoo ISO. While this guide intends to show you how you get a fully configured Arch Linux system (graphical desktop environment, watching dvds, browsing the internet, working with emails, listening to music) its impossible to show all possibilities and options available. Therefore this guide has to focus on some useful steps, you may want to dig deeper using the Arch Linux Wiki or the Arch Linux Forums.


Obtain the latest ISO

Download the latest Arch Linux ISO.

Install the base system

Boot Arch Linux CD

Insert the CD into your cdrom drive and boot from it. You may have to change the boot order in your computer bios or press a key (mostly F11 or F12) during the bios phase.

Useful options of the Arch Linux CD are:

  • ide-legacy if you have trouble with IDE drives
  • noapic acpi=off pci=routeirq nosmp if your system hangs during the boot process
  • memtest86+ if you want to check your memory for errors

Choose "Arch Linux Installation / Rescue System". If you need to change the boot options press e for editing the boot lines. The system will now boot and present a welcome text with some explanations when ready.

Changing the keymap

Press enter at the welcome screen. If you have a non-US keyboard layout type km at the prompt and choose the appropriate keymap. Choosing "default8x16.psfu.gz" for console font is a safe choice.

Start the Installation

Enter arch/setup to start the installation.

Select an installation source

You will be prompted for an installation source. Choose CD if you use a full (current) ISO, choose ftp if you use the ftp ISO.

Prepare Hard Drive

Select the first menu entry "Prepare Hard Drive". Beware that "Auto-Prepare" is not a safe choice because it will erase the entire hard drive. Therefore we will manually partition the hard drive in this guide. Choose "2. Partition Hard Drives", select the hard drive you want (/dev/sdx) and create some partitions.


Basic Information about partitions: TODO: Add some basic information about partitions (primary, logical...)


Ask two people how you should partition your system and you will get three different answers. What you need at least is one primary partition which contains the root Filesystem. Other candidates for own partitions are /boot (which mainly contains the kernel) and /home (which contains the user data). We will stick in this example guide with one big partition for /.


Basic Information about swap partition: A swap partition is a place on your hard drive where "virtual ram" resides. If you need more RAM than you have physically available Linux can't fullfill the request and an error occurs. A swap partition helps in this situation with expanding the physical RAM with virtual RAM. Linux uses the space on the harddisc to store the information that won't fit into the physical RAM anymore (to be fair its some more complex, because Linux tries to put information into the swap space that weren't frequently used). Because a hard disc is very slow compared to physical RAM this is only a makeshift.


Ask two people about a swap partition and you will get four different answers. If you have plenty of RAM (more than 1024 MB) it may be possible to don't use a swap partition at all. Some people suggest using twice the amount of physical RAM, other recommend using not more than 1024 MB. I believe keeping the swap size between 512 MB and 1 GB is a good choice. Therefore we will create a 1 GB swap space in this example.

Lets start creating the primary partition that will contain the root filesystem. Choose New -> Primary and enter the size you want (something between 4 and 8 GB is a good choice for a full featured Linux system). Put the partition at the beginning of the disk. Select the newly created partition and choose "Bootable" to make this partition bootable. Add another partition for your home directory. Choose another primary partition and set the size to a value you like. The size really depends on what your users store in their home directories, therefore I can not make any suggestions. The size may vary between a few hundred MB for some office documents up to hundreds of GB for videos and mp3s. If you want to use the whole space on your hard disc use the remaining space minus 512 MB - 1 GB for the size. At last we create a third partition for swap. Select a size between 512 MB and 1 GB and change the type to 82 (Linux swap / Solaris).

This is what your Layout should look like (size may vary depending on your decision):

Name	Flags	Part Type	FS Type			[Label]			Size (MB)
-------------------------------------------------------------------------
sda1    Boot	Primary		Linux							(4096 - 8192)
sda2			Primary		Linux							(> 100)
sda3			Primary		Linux swap / Solaris			(512 - 1024)

Choose Write and type yes. Beware that this operation may destroy data on your disk if you deleted partitions. Choose Quit to leave the partitioner. Choose Done to leave this menu and continue with "Set Filesystem Mountpoints"

Set Filesystem Mountpoints

Ar first you will be asked for your swap partition, choose the appropriate (sda3 in this example). You will be asked if you want to create a swap filesystem, select yes. The next question regards to your root file system, choose the partition (sda1 in the example). You will be asked what kind of filesystem you want.

Again, ask two people which filesystem to choose you get 5 answers. Each one has advantages and disadvantages. The major difference is journaling, while only ext2 is no journaling filesystem (something similar to transaction logs in database environments) all other use journals. Ext3 is completly compatible to ext2, therefore you can mount it even with very old rescue cds. A safe choice for the root partition is ext3 and reiserfs. Xfs and Jfs are complicated because grub (the boot manager we will install in the next steps) can't boot from them. Therefore you need a boot partition with a different filesystem (eg. ext2). Create the filesystem by selecting yes. For any additional partition you will be now asked where you want to mount it. In the example only sda2 is left, we choose reiserfs again and mount it under /home. Again create the filesystem and choose Done. Return to main menu.

Select Packages

Now we have to select some packages we want to install. Choose CD as source and select the appropriate cd drive if you have more than one. We want to start with a very basic system, therefore we don't install more than base (keeping all base packages select is a safe choice). It's up to you if you want select more packages, but we will show you later how to install additional software more easily. Step forward to "Install Packages"

Install Packages

This is an easy task because everthing happens automagically. Take yourself a cup of coffee and wait until the installation has finished (press continue if needed).

Configure System

You will be asked if you want to choose hwdetect to gather some information for your configuration. This is recommended so you should choose this option. Now you will be asked if you need support for booting from usb devices, firewire devices, pcmcia devices, nfs shares, software raid arrays, lvm2 volumes and encrypted volumes. Choose yes if you need it, in our example nothing is needed. Now you will be asked which text editor you want to use, choose nano if you are not familiar with vi/vim. You will now get a menu with most important config files for your system. We will only do some minor tweaks at this time. First edit your /etc/rc.conf:

  • Change your LOCALE if needed (e.g. "de_DE.utf8")
  • Change your TIMEZONE if needed (e.g. "Europe/Berlin")
  • Change your KEYMAP if needed (e.g. "de-latin1-nodeadkeys")
  • Change MODULES if you know that an important module is missing (hwdetect should have filled in the most important modules)
  • Change your HOSTNAME
  • Change your Network settings:
    • Don't modify the lo line
    • Adjust the IP adress, netmask and broadcast adress if you are using a static ip
    • Set eth0="dhcp" if you have a router which dynamically assigns an ip adress
    • If you have a static IP set the gateway adress to your the one of your router and remove the ! in front of the ROUTES entry

Use Ctrl+X to leave the editor.

Now we edit /etc/hosts:

  • Add the desired hostname (the one you set in rc.conf before) after localhost
  • If you use a static ip, add a new line <static-ip> hostname.domainname hostname

We shouldn't need to edit /etc/fstab, mkinitcpio.conf and modprobe.con at this point (fstab manages your filesystems, mkinitcpio configures the ramdisk (e.g. booting from raid, encrypted volumes) and modprobe can be used to set some special config options for the modules)

If you use a static ip set your dns server in /etc/resolv.conf (nameserver <ip-adress>)

Now we edit /etc/locale.gen and choose the locales we need (remove the # in front of the line you want). Finally set a Root-Password and make sure that you remember it later. Return to the main menu and continue with installing a kernel.

Install Kernel

Not many choices here, choose v2.6 and continue. You may want to switch your kernel later. A fallback image will be created, keeping mkinitcpio as it is shown is a safe choice. Continue with installing a bootloader.

Install Bootloader

Because we have no secondary operating system in our example we need a bootmanager. Grub is a good choice and a bit easier to configure and maintain than lilo. The shown grub configuration (menu.lst) should be safe choice. The only thing you may want to alter is the resolution of the console. Add a vga=<number> to the first kernel line. A table of resolutions and the according numbers is printed in the menu.lst. Exit the install and type reboot. If everthing went good your new ArchLinux system will boot up and finish with a login prompt (you may want to change the boot order in your bios back to booting from hard disc).

Configuring the base system

We will now show some easy tweaks for the beginning. Login with your root account.

Configuring pacman

Edit /etc/pacman.conf (nano -W /etc/pacman.conf) and remove the # in front of the "Include = /etc/pacman.d/community"-line to add another package sources which offers many useful applications. Now edit /etc/pacman.d/community and move the mirrors which are located near to you up (if you use nano Ctrl+A starts selecting an area, cursor down marks the lines, Ctrl+K cuts the selected area and Ctrl+U uncuts it). Repeat this for all files in /etc/pacman.d/

Configuring the network

Wired Lan

If everthing went fine you already should have an working network. Try ping www.google.de to check this. If you get an "unknown host" error, your network is not configured. Check this with ifconfig, you should see an entry for eth0. You can set a new static ip with ifconfig eth0 <ip address> netmask <netmask> up and the default gateway with route add default gw <ip address of the gateway>. Check if /etc/resolv.conf contains your dns server and add it if it is missing. Check your network again with ping www.google.de. If everything is working now adjust /etc/rc.conf as described in section 2.6 (static ip). If you have a dhcp server/ router in your network try dhcpcd eth0. If this is working adjust /etc/rc.conf as described in section 2.6 (dynamic ip)

Wireless Lan

TODO

Update the system

Now we will update the system using pacman, the package manager of Arch Linux (something similar to apt on Debian and Ubuntu or emerge on Gentoo). Enter pacman -Sy. pacman will now fetch the latest information about available packages. Use pacman -Su to update your system (pacman will show you updated packages, if it just finishes without a message all your packages are up to date).

Add a user

You should not do your every day work using the root account because it is way to powerful for just writing a letter or listening to music. Instead add an useraccount using adduser. While most default options are safe to use, you may want to add at least audio,wheel to your additional groups. Audio allows your user using the audio card while wheel allows switching to the root account with su.

Installing and configuring Xorg

Now we will install Xorg using pacman. Type pacman -S xorg and enter Y. Now we have the base packages we need for running the X Server. You should add the driver for your graphic card now (e.g. xf86-video-<name>). To get a list of all video drivers type pacman -Ss xf86-video | more. If you don't know which graphic card you are using type lspci | grep VGA. Now type Xorg -configure to create a basic X configuration. If you want to test your configuration install xterm and twm with pacman -S xterm xorg-twm, move the xorg.conf.new (mv /root/xorg.conf.new /etc/X11/xorg.conf) and type startx. Exit the X Server with Ctrl+Alt+Backspace. You may want to change some things in your xorg.conf.

Adjusting Keyboard Layout

You may want to change your keyboard layout. To do this edit your /etc/X11/xorg.conf and add these lines in the Input Section (keyboard0) (the example shows a german keyboard layout, alter this to fit your needs).

       Option          "XkbLayout"     "de"
       Option          "XkbVariant"    "nodeadkeys"

Adjusting Mouse

While your mouse should be working out of the box, you may want to use you scroll wheel, add this to your Input Section (mouse0):

       Option      "ZAxisMapping" "4 5 6 7"

Using proprietary Graphics Driver (Nvidia, Ati)

Nvidia Graphic Cards

Install the nvidia drivers with pacman -S nvidia. Adjust your /etc/X11/xorg.conf Device Section with changing Driver "nv" to Driver "nvidia". You may want to add a new section to enable DRI:

Section "DRI"

       Mode    0666

EndSection

Some useful tweaking options in the device section are (beware that these may not work on your system):

       Option          "RenderAccel" "true"
       Option          "NoLogo" "true"
       Option          "AGPFastWrite" "true"
       Option          "EnablePageFlip" "true"

Type modprobe nvidia to load the driver and test your configuration with startx.

Ati Graphic Cards

TODO


Installing and configuring a Desktop Environment

Gnome

Install gnome with pacman -S gnome. Its safe to choose all packages shown. You may want to install a graphical login manager. For gnome gdm is a good choice. Install gdm with pacman -S gdm. Test it with /etc/rc.d/gdm start. If everything is working you may want to autostart gdm when booting your system, add gdm to the daemon section in your /etc/rc.conf.

KDE

Install kde with pacman -S kde. Its safe to choose all packages shown. You may want to install a graphical login manager. For kde kdm is a good choice. Install gdm with pacman -S kdm. Test it with /etc/rc.d/kdm start. If everything is working you may want to autostart kdm when booting your system, add kdm to the daemon section in your /etc/rc.conf.

*box

TODO

fvwm

TODO

Useful Applications

This section will never be complete. It just shows some good applications for the everyday user.

Internet

Firefox and Thunderbird are good applications for browsing the Internet and managing your emails. If you are using Gnome you may want to take a look at epiphany and evolution, if you are using KDE konqueror and kmail could be your choice. Gaim and Kopete are good instant messengers for Gnome respective KDE. PSI is a good alternative.

Office

Openoffice is a complete office suite (similar to Microsoft Office). Abiword is a good small alternative wordprocessor, gnumeric an excel replacement for the gnome desktop. KOffice is a complete office suite for the KDE Desktop. Gimp (or gimpshop) is a pixel based graphic program (similar to Adobe Photoshop) while inkscape is a vector based graphic program (like Adobe Illustrator).

Multimedia

Configure the audio card

Your audio card should already be working but you can't hear anything because it is muted by default. Install the alsa-utils and use alsamixer to adjust the channels. Unmute at least the master and pcm channel (press the M Key) and increase the volume with the cursor up key. Leave the alsamixer with ESC and store the settings with alsactl store. Add alsa to your daemons in /etc/rc.conf to automatically restore the mixer on bootup.

Video Player

VLC

(TODO)Link to instructions for vlc mozilla plugin

Mplayer

(TODO)Mozilla Plugin available, gmplayer for gtk

Totem

(TODO)totem-xine is still the better choice if you want to watch dvds.

Kaffeine

(TODO)

Audio Player

Gnome

(TODO)Banshee, Quodlibet, Exaile, Rhythmbox, Listen are all good audio players. Check gnomefiles.org to compare them.

KDE

(TODO)Amarok is one of the best audio player and music library systems available for kde.

Console

(TODO)Moc is a ncurses based audio player for the console, another good choice is mpd.

Other X-based

(TODO)Xmms, audacious, bmpx.


Codecs and other multimedia content types

DVD

TODO (install libdvdcss if legal in your country)

Flash

Install the flash plugin using pacman -S flashplugin to enable Macromedia (now Adobe) Flash in your browser.

Quicktime

TODO

Realplayer

TODO

TV-Cards

TODO