85
4/23/13 Beginners' Guide — wiki.archlinux.org — Readability www.readability.com/articles/3wuojrwx 1/85 wiki.archlinux.org Beginners' Guide Tip: This guide is also available in multiple pages, rather than one large copy. If you would rather follow it that way, please start here . Preface Introduction Welcome. This document will guide you through the process of installing and configuring Arch Linux ; a simple, lightweight GNU/Linux distribution targeted at competent users. This guide is aimed at new Arch users, but strives to serve as a strong reference and informative base for all. Arch Linux Distribution Highlights: Simple design and philosophy All packages compiled for i686 and x86_64 architectures BSD style init scripts, featuring one centralized configuration file mkinitcpio : A simple and dynamic initramfs creator Pacman package manager is lightweight and agile, with a very modest memory footprint The Arch Build System : A portslike package building

Arch Linux Beginners' Guide

Embed Size (px)

DESCRIPTION

The one and only Arch Linux for beginners!

Citation preview

Page 1: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 1/85

wiki.archlinux.org

Beginners' Guide

Tip: This guide is also available in multiple pages, rather thanone large copy. If you would rather follow it that way, please starthere.

Preface

Introduction

Welcome. This document will guide you through the process ofinstalling and configuring Arch Linux; a simple, lightweightGNU/Linux distribution targeted at competent users. This guideis aimed at new Arch users, but strives to serve as a strongreference and informative base for all.

Arch Linux Distribution Highlights:

Simple design and philosophyAll packages compiled for i686 and x86_64 architecturesBSD style init scripts, featuring one centralizedconfiguration filemkinitcpio: A simple and dynamic initramfs creatorPacman package manager is lightweight and agile, with avery modest memory footprintThe Arch Build System: A ports­like package building

Page 2: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 2/85

system, providing a simple framework to create installableArch packages from sourceThe Arch User Repository: offering many thousands of usercontributed build scripts and the opportunity to share yourown

License

Arch Linux, pacman, documentation, and scripts are copyright©2002­2007 by Judd Vinet, ©2007­2011 by Aaron Griffin andare licensed under the GNU General Public License Version 2.

The Arch Way

The design principles behind Arch are aimed at keeping itsimple.

'Simple', in this context, shall mean 'without unnecessaryadditions, modifications, or complications'. In short; an elegant,minimalist approach.

Some thoughts to keep in mind as you consider simplicity:

" 'Simple' is defined from a technical standpoint, not ausability standpoint. It is better to be technically elegantwith a higher learning curve, than to be easy to use andtechnically [inferior]." ­Aaron GriffinEntia non sunt multiplicanda praeter necessitatem or"Entities should not be multiplied unnecessarily." ­Occam'srazor. The term razor refers to the act of shaving away

Page 3: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 3/85

unnecessary complications to arrive at the simplest

explanation, method or theory."The extraordinary part of [my method] lies in itssimplicity..The height of cultivation always runs tosimplicity." ­ Bruce Lee

About This Guide

The community­maintained Arch wiki is an excellent resourceand should be consulted for issues first. The IRC channel(irc://irc.freenode.net/#archlinux), and the forums are alsoavailable if the answer cannot be found elsewhere. Also, be sureto check out the man pages for any command you areunfamiliar with; this can usually be invoked with man command.

Note: Following this guide closely is essential in order tosuccessfully install a properly configured Arch Linux system, soplease read it thoroughly. It is strongly recommended you readeach section completely before carrying out the tasks contained.

The guide is divided into 4 main components:

Prepare the Installation

Note: If you wish to install to another partition from within anexisting GNU/Linux distro or LiveCD, please see this wiki articlefor steps to do this. This can be useful particularly if you plan toinstall Arch via vnc or ssh remotely. The following assumesinstallation by conventional means.

Page 4: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 4/85

Obtain the latest Installation media

You can obtain Arch's official installation media from here. Thelatest version is 2010.05

Both the Core and the Netinstall images provide only thenecessary packages to create an Arch Linux base system.Note that the Base System does not include a GUI. It ismainly comprised of the GNU toolchain (compiler,assembler, linker, libraries, shell, and utilities), the Linuxkernel, and a few extra libraries and modules.Core images facilitate both installing from CD and Net.Netinstall images are smaller and provide no packagesthemselves; the entire system is retrieved via internet.The Arch64 FAQ can help you choose between the 32­, 64­bit and dual versions.Don't forget to download the checksum txt files along withyour chosen ISO.

Check the Integrity of the Downloaded File

cd to the directory where the downloaded files have beenplaced, and invoke sha1sum:

$ sha1sum --check name_of_checksum_file.txt name_of_selected_iso_file.iso

This should give you an "OK" for the one you have. (Simplyignore other lines.) If not, download all files again. The md5sumcheck works the same way.

Page 5: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 5/85

Install Over a Network

Instead of writing the boot media to a disc or USB drive, you mayalternatively boot the .iso image over the network. This workswell when you already have a server set up. Please see this articlefor more information, and then continue to Boot Arch LinuxInstaller

CD installer

Burn the .iso image file to a CD or DVD media with yourpreferred CD/DVD burner drive and software, and continue withBoot Arch Linux Installer

Note: The quality of optical drives, as well as the CD media itself,vary greatly. Generally, using a slow burn speed is recommendedfor reliable burns; Some users recommend speeds as low as 4x or2x. If you are experiencing unexpected behavior from the CD, tryburning at the minimum speed supported by your system.

Flash Memory Device or USB stick

See Install from a USB flash drive for more detailed instructions.

This method will work for any type of flash media from whichyour BIOS will let you boot, be it a card reader or USB port.

Warning: This procedure will irrevocably destroy all data on yourmedia! Also, be very careful where you send the image iso, as dd will obediently write to any target you point to, even if thatis your hard disk.

Page 6: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 6/85

*nix Method

Insert an empty or expendable flash device, determine its path,and write the .iso to the device with the dd program:

# dd if=archlinux-2010.05-core|netinstall-i686|x86_64|dual.iso of=/dev/sdx

where if= is the path to the .iso file and of= is your flashdevice. Make sure to use /dev/sdx and not /dev/sdx1. You willneed a flash memory device large enough to accommodate theimage.

To verify that the image was successfully written to the flashdevice, make a note of the number of records (blocks) read in andwritten out, then perform the following check:

$ dd if=/dev/sdx count=number_of_records status=noxfer | md5sum

The md5sum returned should match the md5sum of thedownloaded archlinux image file (2010.05); they both shouldmatch the md5sum of the image as listed in the md5sums file inthe mirror distribution site. A typical run will look like this:

$ [sudo] dd if=archlinux-2010.05-core-i686.iso

of=/dev/sdc #Write .iso to drive

744973+0 records in 744973+0 records out 381426176 bytes (381 MB) copied, 106.611 s,

Page 7: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 7/85

3.6 MB/s

$ [sudo] dd if=/dev/sdc count=744973

status=noxfer | md5sum #Verify integrity

4850d533ddd343b80507543536258229 - 744973+0 records in 744973+0 records out

Continue with Boot Arch Linux Installer

Microsoft Windows Method

Download Disk Imager from https://launchpad.net/win32­image­writer/+download. Insert flash media. Start the Disk Imager andselect the image file (Disk Imager accepts only *.IMG files, soyou'll have to put "*.iso" in file open dialog to select Archsnapshot). Select the drive letter associated with the flash drive.Click "write".

There are also other solutions to writing bootable ISO images toUSB sticks. If you have problems with USB sticks disconnecting,try using different USB port and/or cable.

Continue with Boot Arch Linux Installer

Boot Arch Linux Installer

Tip: The memory requirement for a basic install is 64 MB ofRAM.

Page 8: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 8/85

Tip: During the process, the automatic screen blanker may comeon. If so, one can press the Alt key to safely obtain the normaldisplay.

Boot from the Media

Insert the CD or Flash media you prepared, and boot from it. Youmay have to change the boot order in your computer BIOS orpress a key (usually DEL, F1, F2, F11 or F12) during the BIOSPOST (Power On Self­Test) phase.

Main Menu: The main menu should be displayed at this point.Select the preferred choice by using the arrow keys to highlightyour choice, and then by pressing Enter. Menus vary slightlyamong the different ISOs.

Note: Users seeking to perform the Arch Linux installationremotely via an ssh connection are encouraged to make a fewtweaks at this point to enable ssh connections directly to the liveCD environment. If interested, see the Install from SSH article.

OS System Start

The system will now load and present a login prompt. Login as'root', without the quotes.

If using an Intel video chipset and the screen goes blank duringthe boot process, the problem is likely an issue with kernel modesetting. A possible workaround may be achieved by rebootingand pressing <Tab> at the GRUB menu to enter kernel options.At the end of the kernel line, add a space and then:

Page 9: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 9/85

i915.modeset=0

Alternatively, add:

video=SVIDEO-1:d

which (if it works) will not disable kernel mode setting.

When done making any changes to any menu command, simplypress "Enter" to boot with that setup.

See the Intel article for more information.

Changing the keymap

If you have a non­US keyboard layout you can interactivelychoose your keymap/console font with the command:

# km

or use the loadkeys command:

# loadkeys layout

where layout is your keyboard layout such as " fr" or " be-latin1"

Documentation

The official install guide is conveniently available right on thelive system! To access it, change to tty2 (virtual console #2) with<ALT>+F2, log in as "root" and then invoke /usr/bin/less

Page 10: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 10/85

by typing in the following at the # prompt:

# less /usr/share/aif/docs/official_installation_guide_en

less will allow you to page through the document.

Change back to tty1 with <ALT>+F1 to follow the rest of theinstall process. (Change back to tty2 at any time if you need toreference the Official Guide as you progress through theinstallation process.)

Tip: Please note that the official guide only covers installationand configuration of the base system. Once that is installed, it isstrongly recommended that you come back here to the wiki tofind out more about post­installation considerations and otherrelated issues.

Install the Base System

As root, run the installer script from tty1:

# /arch/setup

You should next see the displayed Arch Linux InstallationFramework screen.

Select an installation source

Page 11: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 11/85

After a welcome screen, you will be prompted for an installationsource. Choose the appropriate source for the installer you areusing. If using a Netinstall image, relative speed and updatestatus of source repository mirrors may be checked here.

If you chose the CORE installer and wish to use thepackages on the CD, select CD­ROM as sourceAlternatively, or if you're using the Netinstall installationmedia, select NET and see section below (ConfigureNetwork).

Configure Network (Netinstall)

You shall be prompted to load ethernet drivers manually, ifdesired. Udev is quite effective at loading the required modules,so you may assume it has already done so. At the next screen,select Setup Network. You may verify this by pressing <Alt>+F3and invoking ifconfig ­a. When done, return to tty1 by pressing<Alt>+F1

Available Interfaces will be presented. If an interface andHWaddr (HardWare address) is listed, then your module hasalready been loaded. If your interface is not listed, you may probeit from the installer, or manually do so from another virtualconsole. Select your interface to continue.

The installer will then ask if you wish to use DHCP. ChoosingYes will run dhcpcd to discover an available gateway and requestan IP address; Choosing No will prompt you for your static IP,

Page 12: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 12/85

netmask, broadcast, gateway DNS IP, HTTP proxy, and FTPproxy. Afterwards, you will be returned to the Net InstallationMenu

Select Choose Mirror and select an FTP/HTTP mirror. Whenfinished, return to main menu.

Note: archlinux.org is throttled to 50KB/s

(A)DSL Quickstart for the Live Environment

(If you have a modem or router in bridge mode to connect to yourISP)

Switch to another virtual console (<Alt> + F2), login as root andinvoke

# pppoe-setup

If everything is well configured in the end you can connect toyour ISP with

# pppoe-start

Return to first virtual console with <ALT>+F1. Continue with SetClock

Wireless Quickstart For the Live Environment

(If you need wireless connectivity during the installation process)

Page 13: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 13/85

The wireless drivers and utilities are now available to you in thelive environment of the installation media. A good knowledge ofyour wireless hardware will be of key importance to successfulconfiguration. Note that the following quickstart procedureexecuted at this point in the installation will initialize yourwireless hardware for use in the live environment of theinstallation media. These steps (or some other form of wirelessmanagement) must be repeated from the actual installed systemafter booting into it.

Also note that these steps are optional if wireless connectivity isunnecessary at this point in the installation; wireless functionalitymay always be established later.

Note: The following examples use wlan0 for the interface and'linksys' for the ESSID. Remember to change these for yoursituation.

The basic procedure will be:

Switch to a free virtual console, e.g.: <ALT>+F3Login as root(Optional) Identify the wireless interface:

# lspci | grep -i net

Ensure udev has loaded the driver, and that the driver hascreated a usable wireless kernel interface with /usr/sbin/iwconfig:

Page 14: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 14/85

# iwconfig

lo no wireless extensions. eth0 no wireless extensions. wlan0 unassociated ESSID:"" Mode:Managed Channel=0 Access Point: Not-Associated Bit Rate:0 kb/s Tx-Power=20 dBm Sensitivity=8/0 Retry limit:7 RTS thr:off Fragment thr:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0

wlan0 is the available wireless interface in this example.

Note: If you do not see output similar to this, then your wirelessdriver has not been loaded. If this is the case, you must load thedriver yourself. Please see Wireless Setup for more detailedinformation.

Bring the interface up with /sbin/ifconfig <interface> up.

# ifconfig wlan0 up

Page 15: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 15/85

A small percentage of wireless chipsets also require firmware, inaddition to a corresponding driver. If the wireless chipset requiresfirmware, you are likely to receive this error when bringing theinterface up:

# ifconfig wlan0 up

SIOCSIFFLAGS: No such file or directory

If unsure, invoke /usr/bin/dmesg to query the kernel log fora firmware request from the wireless chipset. Example outputfrom an Intel chipset which requires and has requested firmwarefrom the kernel at boot:

$ dmesg | grep firmware

firmware: requesting iwlwifi-5000-1.ucode

If there is no output, it may be concluded that the system'swireless chipset does not require firmware.

Note: Wireless chipset firmware packages (for cards whichrequire them) are pre­installed under /lib/firmware in the liveenvironment (on CD/USB stick) but must be explicitly installed toyour actual system to provide wireless functionality after youreboot into it! Package selection and installation is covered laterin this guide. Ensure installation of both your wireless moduleand firmware during the package selection step! See WirelessSetup if you are unsure about the requirement of correspondingfirmware installation for your particular chipset. This is a very

Page 16: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 16/85

common error.

If the ESSID has been forgotten or is unknown, use /sbin/iwlist <interface> scan to scan for nearbynetworks.

# iwlist wlan0 scan

Using WPA encryption requires that the key be encrypted andstored in a file, along with the ESSID, to be used later forconnection via wpa_supplicant. Thus, a few extra steps arerequired:

For the purpose of simplifying and backup, rename the defaultwpa_supplicant.conf file:

# mv /etc/wpa_supplicant.conf /etc/wpa_supplicant.conf.original

Using wpa_passphrase, provide your wireless network nameand WPA key to be encrypted and written to/etc/wpa_supplicant.conf

The following example encrypts the key 'my_secret_passkey' ofthe 'linksys' wireless network, generates a new configuration file(<file>/etc/wpa_supplicant.conf</file>), and subsequentlyredirects the encrypted key, writing it to the file:

# wpa_passphrase linksys "my_secret_passkey" > /etc/wpa_supplicant.conf

Page 17: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 17/85

Check WPA Supplicant for more information andtroubleshooting.

Note: /etc/wpa_supplicant.conf is stored in plain text format. Thisisn't risky in the installation environment, but when you rebootinto your new system and reconfigure WPA, remember to changethe permissions on /etc/wpa_supplicant.conf (e.g. chmod 0600/etc/wpa_supplicant.conf to make it readable by root only).

Associate your wireless device with the access point youwant to use. Depending on the encryption (none, WEP, orWPA), the procedure may differ. You need to know thename of the chosen wireless network (ESSID).

Page 18: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 18/85

Encryption CommandNo Encryption iwconfig wlan0 essid "linksys"

WEP w/ Hex Key iwconfig wlan0 essid "linksys" key "0241baf34c"

WEP w/ ASCIIpassphrase

iwconfig wlan0 essid "linksys" key "s:pass1"

WPA wpa_supplicant -B -Dwext -i wlan0 -c /etc/wpa_supplicant.conf

Note: The network connection process may be automated later byusing the default Arch network daemon, netcfg, wicd, or anothernetwork manager of your choice.

After utilizing the appropriate association method outlinedabove, wait a few moments and confirm you havesuccessfully associated to the access point beforecontinuing. e.g.:

# iwconfig wlan0

Output should indicate the wireless network is associated with theinterface.

Request an IP address with /sbin/dhcpcd <interface> . e.g.:

# dhcpcd wlan0

Lastly, ensure you can route using /bin/ping:

# ping -c 3 www.google.com

Page 19: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 19/85

You should have a working network connection. Fortroubleshooting, check the detailed Wireless Setup page.

Return to tty1 with <ALT>+F1. Continue with Set Clock

Set Clock

UTC ­ Choose UTC if running only UNIX­like operatingsystem(s).localtime ­ Choose local if multi­booting with a MicrosoftWindows OS.

Prepare Hard Drive

Warning: Partitioning hard drives can destroy data. You arestrongly cautioned and advised to backup your critical data ifapplicable.

Note: Partitioning may be performed before initiating the Archinstallation if desired, by utilizing GParted or other availabletools. If the installation drive has already been partitioned to therequired specifications, continue with Set FilesystemMountpoints

Verify current disk identities and layout by invoking /sbin/fdisk with the -l (lower­case L) switch.

Open another virtual console (<ALT>+F3) and enter:

# fdisk -l

Page 20: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 20/85

Take note of the disk(s)/partition(s) to utilize for the Archinstallation.

Switch back to the installation script with <ALT>+F1

Select the first menu entry "Prepare Hard Drive".

Option 1: Auto­Prepare (Erases an ENTIRE hard drive andsets up partitions)

Auto­Prepare divides the disk into the following configuration:

ext2 /boot partition, default size 32MB. You will beprompted to modify the size to your requirement.swap partition, default size 256MB. You will be prompted tomodify the size to your requirement.A Separate / and /home partition, (sizes can also bespecified). Available filesystems include ext2, ext3, ext4,reiserfs, xfs and jfs, but note that both / and /home shallshare the same fs type if choosing the Auto Prepare option.

Be warned that Auto­prepare will completely erase the chosenhard drive. Read the warning presented by the installer verycarefully, and make sure the correct device is about to bepartitioned.

Option 2: Manually Partition Hard Drives (with cfdisk)­recommended.

Page 21: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 21/85

This option will allow for the most robust and customizedpartitioning solution for your personal needs.

Option 3: Manually Configure block devices, filesystemsand mountpoints

If this is selected, the system will list what filesystems andmountpoints it has found and ask you if you wish to use these. Ifselecting "Yes", you will be given a choice to select the desiredmethod of identification, ie. by dev, label or uuid.

Option 4: Rollback last filesystem changes

At this point, more advanced GNU/Linux users who are familiarand comfortable with manually partitioning may wish to skipdown to Select Packages below.

Partition Hard Drives

Partition Info

Partitioning a hard disk drive defines specific areas (thepartitions) within the disk, that will each appear and behave as aseparate disk and upon which a filesystem may be created(formatted).

There are 3 types of disk partitions:

1. Primary2. Extended3. Logical

Page 22: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 22/85

Primary partitions can be bootable, and are limited to 4 partitionsper disk or raid volume. If a partitioning scheme requires morethan 4 partitions, an extended partition which will contain logicalpartitions will be required.

Extended partitions are not usable by themselves; they are merelya "container" for logical partitions. If required, a hard disk shallcontain only one extended partition; which shall then be sub­divided into logical partitions.

When partitioning a disk, one can observe this numberingscheme by creating primary partitions sda1 through sda3followed by creating an extended partition, sda4, andsubsequently creating logical partition(s) within the extendedpartition; sda5, sda6, and so on.

Swap Partition

A swap partition is a place on the drive where virtual RAMresides, allowing the kernel to easily use disk storage for data thatdoes not fit into physical RAM.

Historically, the general rule for swap partition size was 2x theamount of physical RAM. Over time, as computers have gainedever larger memory capacities, this rule has become increasinglydeprecated. Generally, on machines with up to 512MB RAM, the2x rule is usually quite sufficient. If the installation machineprovides gratuitous amounts of RAM (more than 1024 MB) it

Page 23: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 23/85

may be possible to completely forget a swap partition altogether,since the option to create a swap file is always available later. A 1GB swap partition will be used in this example.

Note: If using suspend­to­disk, (hibernate) a swap partition atleast equal in size to the amount of physical RAM is required.Some Arch users even recommend oversizing it beyond theamount of physical RAM by 10­15%, to allow for possible badsectors.

Partition Scheme

A disk partitioning scheme is a very personalized preference.Each user's choices will be unique to their own computing habitsand requirements. If you would like to dual boot Arch Linux anda Windows operating system please see Windows and Arch DualBoot.

Filesystem candidates for separate partitions include:

/ (root) The root filesystem is the primary filesystem from whichall other filesystems stem; the top of the hierarchy. All files anddirectories appear under the root directory "/", even if they arestored on different physical devices. The contents of the rootfilesystem must be adequate to boot, restore, recover, and/orrepair the system. Therefore, certain directories under / are notthemselves candidates for separate partitions. (See warningbelow).

Page 24: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 24/85

/boot This directory contains the kernel and ramdisk images aswell as the bootloader configuration file, and bootloader stages./boot also stores data that is used before the kernel beginsexecuting userspace programs. This may include saved masterboot sectors and sector map files. /boot is essential for booting,but is unique in that it may still be kept on its own separatepartition (if required).

/home Provides subdirectories, each named for a system user,for miscellaneous personal data storage as well as user­specificconfiguration files for applications.

/usr While root is the primary filesystem, /usr is the secondaryhierarchy for all system users' data, including the majority ofmulti­user utilities and applications. /usr is shareable, read­onlydata. This means that /usr shall be shareable between varioushosts and must not be written to, except in the case of systemupdate/upgrade. Any information that is host­specific or varieswith time is stored elsewhere.

/tmp directory for programs that require temporary files such as'.lck' files, which can be used to prevent multiple instances oftheir respective program until a task is completed, at which pointthe '.lck' file will be removed. Programs must not assume thatany files or directories in /tmp are preserved betweeninvocations of the program and files and directories locatedunder /tmp will typically be deleted whenever the system isbooted.

Page 25: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 25/85

/var contains variable data; spool directories and files,administrative and logging data, pacman's cache, the ABS tree,etc. /var exists in order to make it possible to mount /usr as read­only. Everything that historically went into /usr that is written toduring system operation (as opposed to installation and softwaremaintenance) must reside under /var.

Warning: Besides /boot, directories essential for booting are:'/bin', '/etc', '/lib', and '/sbin'. Therefore, they must not reside on aseparate partition from /.

There are several advantages for using discrete filesystems,rather than combining all into one partition:

Security: Each filesystem may be configured in /etc/fstab as'nosuid', 'nodev', 'noexec', 'readonly', etc.Stability: A user, or malfunctioning program can completelyfill a filesystem with garbage if they have write permissionsfor it. Critical programs, which reside on a differentfilesystem remain unaffected.Speed: A filesystem which gets written to frequently maybecome somewhat fragmented. (An effective method ofavoiding fragmentation is to ensure that each filesystem isnever in danger of filling up completely.) Separatefilesystems remain unaffected, and each can bedefragmented separately as well.Integrity: If one filesystem becomes corrupted, separatefilesystems remain unaffected.Versatility: Sharing data across several systems becomes

Page 26: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 26/85

more expedient when independent filesystems are used.Separate filesystem types may also be chosen based uponthe nature of data and usage.

In this example, we shall use separate partitions for /, /var, /home,and a swap partition.

Note: /var contains many small files. This should be taken intoconsideration when choosing a filesystem type for it, (if creatingits own separate partition).

How big should my partitions be?

This question is best answered based upon individual needs. Youmay wish to simply create one partition for root and one partitionfor swap or only one root partition without swap or refer to thefollowing examples and consider these guidelines to provide aframe of reference:

The root filesystem (/) in the example will contain the /usrdirectory, which can become moderately large, dependingupon how much software is installed. 15­20 GB should besufficient for most users.

The /var filesystem will contain, among other data, the ABStree and the pacman cache. Keeping cached packages isuseful and versatile; it provides the ability to downgradepackages if needed. /var tends to grow in size; the pacmancache can grow large over long periods of time, but can besafely cleared if needed. If you are using an SSD, you may

Page 27: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 27/85

wish to locate your /var on an HDD and keep the / and/home partitions on your SSD to avoid needless read/writesto the SSD. 8­12 Gigs on a desktop system should besufficient for /var, depending largely upon how muchsoftware you intend to install. Servers tend to have relativelylarger /var filesystems.

The /home filesystem is typically where user data,downloads, and multimedia reside. On a desktop system,/home is typically the largest filesystem on the drive by alarge margin. Remember that if you chose to reinstall Arch,all the data on your /home partition will be untouched (solong as you have a separate /home partition).

An extra 25% of space added to each filesystem will providea cushion for unforeseen occurrence, expansion, and serveas a preventive against fragmentation.

From the guidelines above, the example system shall contain a~15GB root (/) partition, ~10GB /var, 1GB swap, and a /homecontaining the remaining disk space.

Create Partitions with cfdisk

Start by creating the primary partition that will contain the root, (/)filesystem.

Choose New ­> Primary and enter the desired size for root (/). Putthe partition at the beginning of the disk.

Page 28: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 28/85

Also choose the Type by designating it as '83 Linux'. The created/ partition shall appear as sda1 in our example.

Now create a primary partition for /var, designating it as Type 83Linux. The created /var partition shall appear as sda2

Next, create a partition for swap. Select an appropriate size andspecify the Type as 82 (Linux swap / Solaris). The created swappartition shall appear as sda3.

Lastly, create a partition for your /home directory. Chooseanother primary partition and set the desired size.

Likewise, select the Type as 83 Linux. The created /homepartition shall appear as sda4.

Example:

Name Flags Part Type FS Type [Label] Size (MB)-------------------------------------------------------------------------sda1 Primary Linux 15440 #rootsda2 Primary Linux 10256 #/varsda3 Primary Linux swap / Solaris 1024 #swapsda4 Primary Linux 140480 #/home

Page 29: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 29/85

Choose Write and type 'yes'. Beware that this operation maydestroy data on your disk. Choose Quit to leave the partitioner.Choose Done to leave this menu and continue with "SetFilesystem Mountpoints".

Note: Since the latest developments of the Linux kernel whichinclude the libata and PATA modules, all IDE, SATA and SCSIdrives have adopted the sdx naming scheme. This is perfectlynormal and should not be a concern.

Set Filesystem Mountpoints

Specify each partition and corresponding mountpoint to yourrequirements. (Recall that partitions end in a number. Therefore,sda is not itself a partition, but rather, signifies an entire drive)

Filesystem Types

Again, a filesystem type is a very subjective matter which comesdown to personal preference. Each has its own advantages,disadvantages, and unique idiosyncrasies. Here is a very briefoverview of supported filesystems:

1. ext2 Second Extended Filesystem­ Old, reliable GNU/Linuxfilesystem. Very stable, but without journaling support. May beinconvenient for root (/) and /home, due to very long fsck's. Anext2 filesystem can easily be converted to ext3.

Page 30: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 30/85

2. ext3 Third Extended Filesystem­ Essentially the ext2 system,but with journaling support. ext3 is backward compatible withext2. Extremely stable, mature, and by far the most widely used,supported and developed GNU/Linux FS.

3. ext4 Fourth Extended Filesystem­ Backward compatible withext2 and ext3. Introduces support for volumes with sizes up to 1exabyte and files with sizes up to 16 terabytes. Increases the32,000 subdirectory limit in ext3 to 64,000. Offers onlinedefragmentation ability.

4. ReiserFS (V3)­ Hans Reiser's high­performance journaling FSuses a very interesting method of data throughput based on anunconventional and creative algorithm. ReiserFS is touted as veryfast, especially when dealing with many small files. ReiserFS isfast at formatting, yet comparatively slow at mounting. Quitemature and stable. ReiserFS (V3) is not actively developed at thistime. Generally regarded as a good choice for /var/.

5. JFS ­ IBM's Journaled FileSystem­ The first filesystem to offerjournaling. JFS had many years of use in the IBM AIX® OSbefore being ported to GNU/Linux. JFS currently uses the leastCPU resources of any GNU/Linux filesystem. Very fast atformatting, mounting and fsck's, and very good all­aroundperformance, especially in conjunction with the deadline I/Oscheduler. (See JFS.) Not as widely supported as ext or ReiserFS,but very mature and stable.

Page 31: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 31/85

6. XFS ­ Another early journaling filesystem originally developedby Silicon Graphics for the IRIX OS and ported to GNU/Linux.XFS offers very fast throughput on large files and largefilesystems. Very fast at formatting and mounting. Generallybenchmarked as slower with many small files, in comparison toother filesystems. XFS is very mature and offers onlinedefragmentation ability.

7. Btrfs ­ Also known as "Better FS" is a new filesystem withsubstantial new and powerful features similar to Sun/Oracle'sexcellent ZFS. These include snapshots, multi­disk striping andmirroring (basically software raid without mdadm), checksums,incremental backup, and on­the­fly compression (which can givea significant performance boost as well as save space), and more.It is still considered "unstable" as of January 2011, but has beenmerged into the mainline kernel under experimental status. Btrfslooks to be the future of linux filesystems, and is now offered as aroot filesystem choice in Ubuntu 10.10, OpenSUSE 11.3 andother major distribution installers.

JFS and XFS filesystems cannot be shrunk by disk utilities(such as gparted or parted magic)

A note on Journaling

All above filesystems, except ext2, utilize journaling. Journalingfile systems are fault­resilient file systems that use a journal to logchanges before they are committed to the file system to avoidmetadata corruption in the event of a crash. Note that not alljournaling techniques are alike; specifically, only ext3 and ext4

Page 32: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 32/85

offer data­mode journaling, (though, not by default), whichjournals both data and meta­data (but with a significant speedpenalty). The others only offer ordered­mode journaling, whichjournals meta­data only. While all will return your filesystem to avalid state after recovering from a crash, data­mode journalingoffers the greatest protection against file system corruption anddata loss but can suffer from performance degradation, as all datais written twice (first to the journal, then to the disk). Dependingupon how important your data is, this may be a consideration inchoosing your filesystem type.

Moving on...

Choose and create the filesystem (format the partition) for / byselecting yes. You will now be prompted to add any additionalpartitions. In our example, sda2 and sda4 remain. For sda2,choose a filesystem type and mount it as /var. Finally, choose thefilesystem type for sda4, and mount it as /home.

Note: If you have not created and do not need a separate /bootpartition, you may safely ignore the warning that it does not exist.

Return to the main menu.

Select Packages

All packages during installation are from the [core] repository.They are further divided into Base, and Base­devel. Packageinformation and brief descriptions are available here.

First, select the package category:

Page 33: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 33/85

Note: For expedience, all packages in base are selected bydefault. Use the space­bar to select and de­select packages.

Base

Packages from the [core] repo to provide the minimal baseenvironment. Always select this and only remove packagesthat will not be used.

Base­devel

Extra tools from [core] such as make, and automake.Most beginners should choose to install it, as many willprobably need it later.

After category selection, you will be presented with the full listsof packages, allowing you to fine­tune your selections. Use thespace bar to select and unselect.

Note: If connection to a wireless network is required, rememberto select and install the wireless_tools package. Some wirelessinterfaces also need ndiswrapper and/or a specific firmware. Ifyou plan to use WPA encryption, you will need wpa_supplicant.The Wireless Setup page will help you choose the correctpackages for your wireless device. Also strongly considerinstalling netcfg, which will help you set up your networkconnection and profiles after you reboot into your new system.

After selecting the needed packages, leave the selection screenand continue to the next step, Install Packages.

Install Packages

Page 34: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 34/85

Install Packages will install the selected packages to your newsystem. If you selected a CD/USB as the source, packageversions from the CD/USB will be installed. If you opted for aNetinstall, fresh packages will be downloaded from the internetand installed.

Note: In some installers, you will be asked if you wish to keepthe packages in the pacman cache. If you choose 'yes', you willhave the flexibility to downgrade to previous package versions inthe future, so this is recommended (you can always clear thecache in the future).

After the packages have been downloaded, the installer willcheck their integrity. Next it will create the kernel from thepackages downloaded.

Configure the System

Tip: Closely following and understanding these steps is of keyimportance to ensure a properly configured system.

At this stage of the installation, you will configure the primaryconfiguration files of your Arch Linux base system. Previousversions of the installer included hwdetect to gather informationfor your configuration. This has been deprecated and replacedwith udev, which should handle most module loadingautomatically at boot.

Page 35: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 35/85

Now you will be asked which text editor you want to use; choosenano, joe or [[Vim|vi]. nano is generally considered the easiest ofthe three. Please see the releated wiki pages of the editor youwish to use for instructions on how to use them. You will bepresented with a menu including the main configuration files foryour system.

Note: It is very important at this point to edit, or at least verify byopening, every configuration file. The installer script relies onyour input to create these files on your installation. A commonerror is to skip over these critical steps of configuration.

Can the installer handle this more automatically?

Hiding the process of system configuration is in direct oppositionto The Arch Way. While it is true that recent versions of thekernel and hardware probing tools offer excellent hardwaresupport and auto­configuration, Arch presents the user allpertinent configuration files during installation for the purposes oftransparency and system resource control. By the time you havefinished modifying these files to your specifications, you willhave learned the simple method of manual Arch Linux systemconfiguration and become more familiar with the base structure,leaving you better prepared to use and maintain your newinstallation productively.

/etc/rc.conf

Page 36: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 36/85

Arch Linux uses the file /etc/rc.conf as the principal location forsystem configuration. This one file contains a wide range ofconfiguration information, principally used at system startup. Asits name directly implies, it also contains settings for and invokesthe /etc/rc* files, and is, of course, sourced by these files.

LOCALIZATION section

Example for LOCALIZATION:

LOCALE="en_US.utf8"HARDWARECLOCK="localtime"USEDIRECTISA="no"TIMEZONE="US/Eastern"KEYMAP="us"CONSOLEFONT=CONSOLEMAP=USECOLOR="yes"

LOCALE

This sets your system locale, which will be used by all i18n­aware applications and utilities. You can get a list of theavailable locales by running locale ­a from the commandline. This setting's default is usually fine for US Englishusers. However if you experience any problems such assome characters not printing right and being replaced bysquares you may want to go back and replace "en_US.utf8"with just "en_US".

HARDWARECLOCK

Page 37: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 37/85

Specifies whether the hardware clock, which issynchronized on boot and on shutdown, stores UTC time, orlocaltime. UTC makes sense because it greatly simplifieschanging timezones and daylight savings time. localtime isnecessary if you dual boot with an operating system such asWindows, that only stores localtime to the hardware clock.

USEDIRECTISA

Use direct I/O request instead of /dev/rtc for hwclock

TIMEZONE

Specify your TIMEZONE. (All available zones are under/usr/share/zoneinfo/).

KEYMAP

The available keymaps are in /usr/share/kbd/keymaps.Please note that this setting is only valid for your TTYs, notany graphical window managers or X.

CONSOLEFONT

Available console fonts reside under/usr/share/kbd/consolefonts/ if you must change. The default(blank) is safe.

CONSOLEMAP

Defines the console map to load with the setfont program atboot. Possible maps are found in/usr/share/kbd/consoletrans, if needed. The default (blank) is

Page 38: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 38/85

safe.

USECOLOR

Select "yes" if you have a color monitor and wish to havecolors in your consoles.

HARDWARE Section

Example for HARDWARE:

# Scan hardware and load required modules at bootMOD_AUTOLOAD="yes"# Module Blacklist - DeprecatedMOD_BLACKLIST=()#MODULES=(!net-pf-10 !pcspkr loop)

MOD_AUTOLOAD

Setting this to "yes" will use udev to automatically probehardware and load the appropriate modules during boot,(convenient with the default modular kernel). Setting this to"no" will rely on the user's ability to specify this informationmanually, or compile their own custom kernel and modules,etc.

MOD_BLACKLIST

This has become deprecated in favor of adding blacklistedmodules directly to the MODULES= line below.

MODULES

Page 39: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 39/85

Specify additional MODULES if you know that an importantmodule is missing. If your system has any floppy drives, add"floppy". If you will be using loopback filesystems, add"loop". Also specify any blacklisted modules by prefixingthem with a bang (!). Udev will be forced NOT to loadblacklisted modules. In the example, the IPv6 module aswell as the annoying pcspeaker are blacklisted.

NETWORKING Section

HOSTNAME

Set your HOSTNAME to your liking. This is the name ofyour computer. Whatever you put here, also put it in/etc/hosts

eth0

'Ethernet, card 0'. If you are using static IP, adjust theinterface IP address, netmask and broadcast address. Seteth0="dhcp" if you want to use DHCP fordynamic/automatic configuration.

INTERFACES

Specify all interfaces here. Multiple interfaces should beseparated with a space as in: (eth0 wlan0)

gateway

If you are using static IP, set the gateway address. If usingDHCP, you can usually ignore this variable, though someusers have reported the need to define it.

Page 40: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 40/85

ROUTES

If you are using static IP, remove the ! in front of 'gateway'.If using DHCP, you can usually leave this variablecommented out with the bang (!), but again, some usersrequire the gateway and ROUTES defined. If youexperience networking issues with pacman, for instance,you may want to return to these variables.

Example w/ Dynamic IP (DHCP):

HOSTNAME="arch"#eth0="eth0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"eth0="dhcp"INTERFACES=(eth0)gateway="default gw 192.168.0.1"ROUTES=(!gateway)

Example w/ Static IP:

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

When using a static IP, modify /etc/resolv.conf to specify theDNS servers of choice. Please see the section below regardingthis file.

Note: Remember, connecting to a wireless network automatically

Page 41: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 41/85

requires a few more steps and may require you to set up anetwork manager such as netcfg or wicd. Please see the WirelessSetup page for more information

Tip: If using a non­standard MTU size (a.k.a. jumbo frames) isdesired AND the installation machine hardware supports them,see the Jumbo Frames wiki article for further configuration.

DAEMONS Section

This array simply lists the names of those scripts contained in/etc/rc.d/ which are to be started during the boot process, and theorder in which they start. Asynchronous initialization bybackgrounding is also supported and useful for speeding up boot.

DAEMONS=(network @syslog-ng netfs @crond)

If a script name is prefixed with a bang (!), it is not executed.If a script is prefixed with an "at" symbol (@), it shall beexecuted in the background; the startup sequence will notwait for successful completion of each daemon beforecontinuing to the next. (Useful for speeding up system boot).Do not background daemons that are needed by otherdaemons. For example "mpd" depends on "network",therefore backgrounding network may cause mpd to break.Edit this array whenever new system services are installed, ifstarting them automatically during boot is desired.

Page 42: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 42/85

Note: This 'BSD­style' init, is the Arch way of handling whatother distributions handle with various symlinks to an /etc/init.ddirectory.

About DAEMONS

The daemons line need not be changed at this time, but it isuseful to explain what daemons are, as they will be addressedlater in this guide.

A daemon is a program that runs in the background, waiting forevents to occur and offering services. A good example is a webserver that waits for a request to deliver a page (e.g.:httpd) or anSSH server waiting for a user login (e.g.:sshd). While these arefull­featured applications, there are also daemons whose work isnot that visible. Examples are a daemon which writes messagesinto a log file (e.g. syslog, metalog), and a daemon whichprovides a graphical login (e.g.: gdm, kdm). All these programscan be added to the daemons line and will be started when thesystem boots. Useful daemons will be presented during thisguide.

Historically, the term daemon was coined by the programmers ofMIT's Project MAC. They took the name from Maxwell's demon,an imaginary being from a famous thought experiment thatconstantly works in the background, sorting molecules. *nixsystems inherited this terminology and created the backronymdisk and execution monitor.

Tip: All Arch daemons reside under /etc/rc.d/

Page 43: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 43/85

/etc/fstab

The fstab (for file systems table) is part of the systemconfiguration listing all available disks and disk partitions, andindicating how they are to be initialized or otherwise integratedinto the overall system's filesystem. The /etc/fstab file is mostcommonly used by the mount command. The mount commandtakes a filesystem on a device, and adds it to the main systemhierarchy that you see when you use your system. mount ­a iscalled from /etc/rc.sysinit, about 3/4 of the way through the bootprocess, and reads /etc/fstab to determine which options shouldbe used when mounting the specified devices therein. If noauto isappended to a filesystem in /etc/fstab, mount ­a will not mount itat boot.

An example of /etc/fstab

# <file system> <dir> <type> <options> <dump> <pass>none /dev/pts devpts defaults 0 0none /dev/shm tmpfs defaults 0 0/dev/sda1 / jfs defaults,noatime 0 1/dev/sda2 /var reiserfs defaults,noatime,notail 0 2

Page 44: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 44/85

/dev/sda3 swap swap defaults 0 0/dev/sda4 /home jfs defaults,noatime 0 2

Note: The 'noatime' option disables writing read access times tothe metadata of files and may safely be appended to / and /homeregardless of your specified filesystem type for increased speed,performance, and power efficiency (see here for more). 'notail'disables the ReiserFS tailpacking feature, for added performanceat the cost of slightly less efficient disk usage.

<file system>

describes the block device or remote filesystem to be mounted.For regular mounts, this field will contain a link to a blockdevice node (as created by mknod which is called by udev atboot) for the device to be mounted; for instance, '/dev/cdrom'or '/dev/sda1'.

Note: If your system has more than one hard drive, the installerwill default to using UUID rather than the sdx naming scheme,for consistent device mapping. Utilizing UUID has severaladvantages and may also be preferred to avoid issues if harddisks are added to the system in the future. Due to activedevelopments in the kernel and also udev, the ordering inwhich drivers for storage controllers are loaded may changerandomly, yielding an unbootable system/kernel panic. Nearlyevery motherboard has several controllers (onboard SATA,

Page 45: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 45/85

onboard IDE), and due to the aforementioned developmentupdates, /dev/sda may become /dev/sdb on the next reboot.(See this wiki article for more information on persistent blockdevice naming. )

<dir>

describes the mount point for the filesystem. For swappartitions, this field should be specified as 'swap'; (Swappartitions are not actually mounted.)

<type>

describes the type of the filesystem. The Linux kernel supportsmany filesystem types. (For the filesystems currently supportedby the running kernel, see /proc/filesystems). An entry 'swap'denotes a file or partition to be used for swapping. An entry'ignore' causes the line to be ignored. This is useful to showdisk partitions which are currently unused.

<options>

describes the mount options associated with the filesystem. It isformatted as a comma­separated list of options with nointervening spaces. It contains at least the type of mount plusany additional options appropriate to the filesystem type. Fordocumentation on the available options for non­nfs filesystems, see mount(8).

<dump>

used by the dump(8) command to determine which filesystems

Page 46: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 46/85

are to be dumped. dump is a backup utility. If the fifth field isnot present, a value of zero is returned and dump will assumethat the filesystem does not need to be backed up. Note thatdump is not installed by default.

<pass>

used by the fsck(8) program to determine the order in whichfilesystem checks are done at boot time. The root filesystemshould be specified with a <pass> of 1, and other filesystemsshould have a <pass> of 2 or 0. Filesystems within a drive willbe checked sequentially, but filesystems on different driveswill be checked at the same time to utilize parallelism availablein the hardware. If the sixth field is not present or zero, a valueof zero is returned and fsck will assume that the filesystemdoes not need to be checked.

Expanded information available in the Fstab wiki entry.

Most users will not need to modify this file at this time, but pleaseread the following explanatory information.

This file allows further fine­tuning of the initial ram filesystem, orinitramfs, (also historically referred to as the initial ramdisk or"initrd") for your system. The initramfs is a gzipped image that isread by the kernel during boot. The purpose of the initramfs is tobootstrap the system to the point where it can access the rootfilesystem. This means it has to load any modules that arerequired for devices like IDE, SCSI, or SATA drives (orUSB/FW, if you are booting from a USB/FW drive). Once the

Page 47: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 47/85

initrramfs loads the proper modules, either manually or throughudev, it passes control to the kernel and your boot continues. Forthis reason, the initramfs only needs to contain the modulesnecessary to access the root filesystem. It does not need tocontain every module you would ever want to use. The majorityof common kernel modules will be loaded later on by udev,during the init process.

mkinitcpio is the next generation of initramfs creation. It hasmany advantages over the old mkinitrd and mkinitramfsscripts.

It uses glibc and busybox to provide a small and lightweightbase for early userspace.It can use udev for hardware autodetection at runtime, thuspreventing numerous unnecessary modules from beingloaded.Its hook­based init script is easily extendable with customhooks, which can easily be included in pacman packageswithout having to modifiy mkinitcpio itself.It already supports lvm2, dm­crypt for both legacy and luksvolumes, raid, swsusp and suspend2 resuming and bootingfrom usb mass storage devices.Many features can be configured from the kernel commandline without having to rebuild the image.The mkinitcpio script makes it possible to include the imagein a kernel, thus making a self­contained kernel image ispossible.Its flexibility makes recompiling a kernel unnecessary in

Page 48: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 48/85

many cases.

If using RAID or LVM on the root filesystem, the appropriateHOOKS must be configured. See the wiki pages for RAID and/etc/mkinitcpio for more info. If using a non­US keyboard. addthe " keymap" hook to load your local keymap during boot.Add the " usbinput" hook if using a USB keyboard. Don'tforget to add the " usb" hook when installing arch on anexternal hard drive, Comfact Flash, or SD card, which isconnected via usb, e.g.:

HOOKS="base udev autodetect pata scsi sata usb filesystems keymap usbinput"

(Otherwise, if boot fails for some reason you will be asked toenter root's password for system maintenance but will be unableto do so.)

If you need support for booting from USB devices, FireWiredevices, PCMCIA devices, NFS shares, software RAID arrays,LVM2 volumes, encrypted volumes, or DSDT support, configureyour HOOKS accordingly.

/etc/modprobe.d/modprobe.conf

This file can be used to set special configuration options for thekernel modules. It is unnecessary to configure this file in theexample.

/etc/resolv.conf

Page 49: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 49/85

Note: If you are using DHCP, you may safely ignore this file, asby default, it will be dynamically created and destroyed by thedhcpcd daemon. You may change this default behavior if youwish. See the Network and Resolv.conf pages for morinformation.

The resolver is a set of routines in the C library that provideaccess to the Internet Domain Name System (DNS). One of themain functions of DNS is to translate domain names into IPaddresses, to make the Web a friendlier place. The resolverconfiguration file, or /etc/resolv.conf, contains information that isread by the resolver routines the first time they are invoked by aprocess.

If you use a static IP, set your DNS servers in /etc/resolv.conf(nameserver <ip­address>). You may have as many as you wish.An example, using OpenDNS:

nameserver 208.67.222.222nameserver 208.67.220.220

If you are using a router, you will probably want to specify yourDNS servers in the router itself, and merely point to it from your/etc/resolv.conf, using your router's IP (which is also yourgateway from /etc/rc.conf). Example:

nameserver 192.168.1.1

Page 50: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 50/85

If using DHCP, you may also specify your DNS servers in therouter, or allow automatic assignment from your ISP, if your ISPis so equipped.

/etc/hosts

This file associates IP addresses with hostnames and aliases, oneline per IP address. For each host a single line should be presentwith the following information:

<IP-address> <hostname> [aliases...]

Add your hostname, coinciding with the one specified in/etc/rc.conf, as an alias, so that it looks like this:

127.0.0.1 localhost.localdomain localhost yourhostname

Warning: This format, including the 'localhost' and your actualhost name, is required for program compatibility! So, if you havenamed your computer "arch", then that line above should looklike this:127.0.0.1 localhost.localdomain localhost arch

Errors in this entry may cause poor network performance and/orcertain programs to open very slowly, or not work at all. This is avery common error for beginners.

Note: Recent versions of the Arch Linux Installer automaticallyadd your hostname to this file once you edit /etc/rc.conf withsuch information. If, for whatever reason, this is not the case, you

Page 51: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 51/85

may add it yourself with the given instructions.

If you use a static IP, add another line using the syntax: <static­IP> <hostname.domainname.org> <hostname> e.g.:

192.168.1.100 yourhostname.domain.org yourhostname

Tip: For convenience, you may also use /etc/hosts aliases forhosts on your network, and/or on the Web, e.g.:64.233.169.103 www.google.com g192.168.1.90 media192.168.1.88 data

The above example would allow you to access google simply bytyping 'g' into your browser, and access to a media and dataserver on your network by name and without the need for typingout their respective IP addresses.

/etc/hosts.deny and /etc/hosts.allow

Modify these configurations according to your needs if you planon using the ssh daemon. The default configuration will reject allincoming connections, not only ssh connections. Edit your/etc/hosts.allow file and add the appropriate parameters:

Let everyone connect to you

sshd: ALL

Restrict it to a certain ip

sshd: 192.168.0.1

Page 52: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 52/85

Restrict it to your local LAN network (range 192.168.0.0 to192.168.0.255)

sshd: 192.168.0.

sshd: 10.0.0.0/255.255.255.0

If you do not plan on using the ssh daemon, leave this file at thedefault, (empty).

/etc/locale.gen

The /usr/sbin/locale-gen command reads from/etc/locale.gen to generate specific locales. They can then beused by glibc and any other locale­aware program or library forrendering text, correctly displaying regional monetary values,time and date formats, alphabetic idiosyncrasies, and otherlocale­specific standards.

By default /etc/locale.gen is an empty file with commenteddocumentation. Once edited, the file remains untouched. locale-gen runs on every glibc upgrade, generating all thelocales specified in /etc/locale.gen.

Choose the locale(s) you need (remove the # in front of the linesyou want), e.g.:

en_US ISO-8859-1en_US.UTF-8

Page 53: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 53/85

The installer will now run the locale­gen script, which willgenerate the locales you specified. You may change your localein the future by editing /etc/locale.gen and subsequently running'locale­gen' as root.

Note: If you fail to choose your locale, this will lead to a "Thecurrent locale is invalid..." error. This is perhaps the mostcommon mistake by new Arch users.

Pacman­Mirror

Choose a mirror repository for pacman. Remember thatarchlinux.org is throttled, limiting downloads to 50KB/s.

Root password

Finally, set a root password and make sure that you remember itlater. Return to the main menu and continue with installingbootloader.

Done

When you select "Done", the system will rebuild the images andput you back to the Main Menu. This may take some time.

Because we have no secondary operating system in our example,we will need a bootloader. GRUB is the recommendedbootloader and will be used in the following examples.Alternatively, you may choose LILO or Syslinux. Please see therelated wiki and documentation pages if you choose to use abootloader other than GRUB.

Page 54: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 54/85

The provided GRUB configuration (/boot/grub/menu.lst) shouldbe sufficient, but verify its contents to ensure accuracy(specifically, ensure that the root (/) partition is specified byUUID on line 3). You may want to alter the resolution of theconsole by adding a vga=<number> kernel argumentcorresponding to your desired virtual console resolution. (A tableof resolutions and the corresponding numbers is printed in themenu.lst.)

Explanation:

title

A printed menu selection. "Arch Linux (Main)" will be printedon the screen as a menu selection.

root

GRUB's root; the drive and partition where the kernel (/boot)resides, according to system BIOS. (More accurately, whereGRUB's stage2 file resides). NOT necessarily the root (/) filesystem, as they can reside on separate partitions. GRUB'snumbering scheme starts at 0, and uses an hdx,x formatregardless of IDE or SATA, and enclosed within parentheses.The example indicates that /boot is on the first partition of thefirst drive, according to the BIOS, so (hd0,0).

kernel

This line specifies:

The path and filename of the kernel relative to GRUB's

Page 55: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 55/85

root. In the example, /boot is merely a directory residingon the same partition as / and vmlinuz26 is the kernelfilename; /boot/vmlinuz26. If /boot were on a separatepartition, the path and filename would be simply/vmlinuz26, being relative to GRUB's root.

The root= argument to the kernel statement specifies thepartition containing the root (/) directory in the bootedsystem, (more accurately, the partition containing/sbin/init). An easy way to distinguish the 2 appearancesof 'root' in /boot/grub/menu.lst is to remember that the firstroot statement informs GRUB where the kernel resides,whereas the second root= kernel argument tells the kernelwhere the root filesystem (/) resides.

Kernel options. In our example, ro mounts the filesystemas read­only during startup, (usually a safe default; youmay wish to change this in case it causes problemsbooting). Depending on hardware, rootdelay=8 may needto be added to the kernel options in order to be able toboot from an external usb hard drive.

initrd

The path and filename of the initial RAM filesystem relative toGRUB's root. Again, in the example, /boot is merely adirectory residing on the same partition as / and kernel26.imgis the initrd filename; /boot/kernel26.img. If /boot were on aseparate partition, the path and filename would be simply/kernel26.img, being relative to GRUB's root.

Page 56: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 56/85

Example

title Arch Linux (Main)root (hd0,0)kernel /boot/vmlinuz26 root=/dev/sda1 roinitrd /boot/kernel26.img

Example for /boot on a separate partition

title Arch Linux (Main)root (hd0,0)kernel /vmlinuz26 root=/dev/sda3 roinitrd /kernel26.img

Install the GRUB bootloader to the master boot record (/dev/sdain our example).

Warning: Make sure to install GRUB on /dev/sdX and not/dev/sdX#! This is a common mistake.

Tip: For more details, see the GRUB wiki page.

Reboot

That's it; You have configured and installed your Arch Linuxbase system. Exit the install, and reboot:

# reboot

Tip: Be sure to remove the installation media and perhaps changethe boot preference in your BIOS; otherwise you may boot backinto the installation!

Page 57: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 57/85

Post­Installation

Congratulations, and welcome to your new Arch Linux basesystem!

This section will cover various must­do procedures afterinstallation such as updating your new system and adding aregular, non­root user.

Update

Your new Arch Linux base system is now a functionalGNU/Linux environment ready for customization. From here,you may build this elegant set of tools into whatever you wish orrequire for your purposes.

Login with the root account. We will configure pacman andupdate the system as root.

Note: Virtual consoles 1­6 are available. You may switchbetween them with <ALT>+F1...F6

Configure the network (if necessary)

If you properly configured your system, you should have aworking network. Try to ping www.google.com to verify:

# ping -c 3 www.google.com

PING www.l.google.com (74.125.229.51) 56(84) bytes of data.

Page 58: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 58/85

64 bytes from 74.125.229.51: icmp_seq=1 ttl=51 time=26.8 ms64 bytes from 74.125.229.51: icmp_seq=2 ttl=51 time=27.4 ms64 bytes from 74.125.229.51: icmp_seq=3 ttl=51 time=26.8 ms

--- www.l.google.com ping statistics ---3 packets transmitted, 3 received, 0% packet loss, time 2002msrtt min/avg/max/mdev = 26.847/27.053/27.436/0.330 ms

If you have successfully established a network connection,continue with Update, Sync, and Upgrade the system withpacman.

If, after trying to ping www.google.com, an "unknown host" erroris received, you may conclude that your network is not properlyconfigured. You may choose to double­check the following filesfor integrity and proper settings:

/etc/rc.conf ­ Specifically, check your HOSTNAME andNETWORKING section for typos and errors.

/etc/hosts ­ Double­check for format, typos, and errors.

/etc/resolv.conf ­ If you are using a static IP. If you are usingDHCP, this file will be dynamically created and destroyed bydefault.

Tip: Advanced instructions for configuring the network can be

Page 59: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 59/85

found in the Network article.

Wired LAN

Check your Ethernet with

# ifconfig -a

All interfaces will be listed. You should see an entry for eth0, orperhaps eth1. These examples will use eth0.

Static IP

If required, 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>

Verify that /etc/resolv.conf contains your DNS server and add it ifit is missing. Check your network again with ping -c 3 www.google.com. If everything is working now, adjust/etc/rc.conf as described above for static IP.

DHCP

If you have a DHCP server/router in your network try:

Page 60: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 60/85

# dhcpcd eth0

If this is working, adjust /etc/rc.conf as described above, fordynamic IP.

Wireless LAN

Please see Wireless Quickstart For the Live Environment fordetails on connecting to a wireless network. Although you are nolonger running off the installation media, the commands are thesame as long as you installed all related wireless packages duringpackage selection. Remember, your wireless device may needfirmware in order to operate. For troubleshooting, check thedetailed Wireless Setup page.

Proxy Server

If you are behind a proxy server, edit /etc/wgetrc and sethttp_proxy and ftp_proxy in it.

Analog Modem, ISDN, and DSL (PPPoE)

See Internet Access for detailed instructions.

Update, Sync, and Upgrade the system with pacman

Now we will update the system using pacman. Pacman is thepackage manager of Arch Linux. It manages your entire packagesystem and handles installation, removal, package downgrade(through cache), custom compiled package handling, automatic

Page 61: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 61/85

dependency resolution, remote and local searches and muchmore. Pacman will now be used to download software packagesfrom remote repositories and install them onto your system.

Note: If you installed via a Netinstall, many, if not all, of yourpackages will already be up to date. However, it is still advisableto run through this update process.

/etc/pacman.conf

pacman will attempt to read /etc/pacman.conf each time it isinvoked. This configuration file is divided into sections, orrepositories. Each section defines a package repository thatpacman can use when searching for packages. The exception tothis is the options section, which defines global options.

Note: The defaults should work, so modifying at this point maybe unnecessary, but verification is always recommended. Furtherinfo available in the Mirrors article.

# nano /etc/pacman.conf

Repositories are described below; enable all desired repositoriesby removing the # in front of the 'Include =' and '[repository]'lines.

Note: When choosing repos, be sure to uncomment both therepository header lines in [brackets] as well as the 'Include ='lines. Failure to do so will result in the selected repository beingomitted! This is a very common error.

Page 62: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 62/85

Package Repositories

A software repository is a storage location from which softwarepackages may be retrieved and installed on a computer. ArchLinux package maintainers (developers and Trusted Users)maintain a number of official repositories containing softwarepackages for essential and popular software, readily accessiblevia pacman. This article outlines those officially­supportedrepositories. See Official Repositories for more informationincluding details about the purpose of each repository.

Most people will want to use [core], [extra] and [community]. Ifyou want to run 32­bit applications on Arch x86_64, enable the[multilib] repository by adding the lines below to/etc/pacman.conf:

[multilib]Include = /etc/pacman.d/mirrorlist

AUR

The AUR also contains the unsupported branch, which cannot beaccessed directly by pacman*. AUR [unsupported] does notcontain binary packages. Rather, it provides more than sixteenthousand PKGBUILD scripts for building packages from source,that may be unavailable through the other repos. When an AURunsupported package acquires enough popular votes, it may bemoved to the AUR [community] binary repo, if a TU is willing toadopt and maintain it there.

TU maintained

Page 63: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 63/85

All PKGBUILD bash build scriptsNot pacman accessible by default

* pacman wrappers (AUR Helpers) can help you seamlesslyaccess AUR.

/etc/pacman.d/mirrorlist

Defines pacman repository mirrors and priorities.

Open /etc/pacman.d/mirrorlist in an editor and uncomment(remove the '#' in front) a server close to you. Then issue acomplete package refresh:

# pacman -Syy

Passing two ­­refresh or ­y flags forces pacman to refresh allpackage lists even if they are considered to be up to date. Issuingpacman ­Syy whenever a mirror is changed, is good practice andwill avoid possible headaches.

rankmirrors

Alternatively, you can use rankmirrors. rankmirrors isa bash script which will attempt to detect uncommented mirrorsspecified in /etc/pacman.d/mirrorlist which are closest to theinstallation machine based on latency. Faster mirrors willdramatically improve pacman performance, and the overall ArchLinux experience. This script may be run periodically, especiallyif the chosen mirrors provide inconsistent throughput and/orupdates. Note that rankmirrors does not test for throughput.

Page 64: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 64/85

Tools such as wget or rsync may be used to effectively testfor mirror throughput after a new /etc/pacman.d/mirrorlist hasbeen generated.

Issue the following command to completely refresh packagedatabase, upgrade and install curl:

# pacman -Syyu curl

If you get an error at this step, use the command "nano/etc/pacman.d/mirrorlist" and uncomment a server that suitsyou.

cd to the /etc/pacman.d/ directory:

# cd /etc/pacman.d

Backup the existing /etc/pacman.d/mirrorlist:

# cp mirrorlist mirrorlist.backup

Edit mirrorlist.backup and uncomment all mirrors on the samecontinent or within geographical proximity to test withrankmirrors.

# nano mirrorlist.backup

Run the script against the mirrorlist.backup with the ­n switch andredirect output to a new /etc/pacman.d/mirrorlist file:

# rankmirrors -n 6 mirrorlist.backup > mirror

Page 65: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 65/85

list

­n 6: rank the 6 closest mirrors

Force pacman to refresh all package lists with the new mirrorlistin place:

# pacman -Syy

Mirrorcheck for up­to­date packages

Since rankmirrors does not take into account how up­to­date a mirror's package list is, it's important to note that one ormore of the mirrors it selects as fastest may still be out­of­date.ArchLinux Mirrorcheck reports various aspects about the mirrorssuch as network problems with mirrors, data collection problems,the last time mirrors have been synced, etc. One may wish tomanually inspect /etc/pacman.d/mirrorlist, ensuring that the filecontains only up­to­date mirrors if having the latest packageversions is a priority.

Alternatively, the Mirrorlist Generator can automatically rankmirrors close to your location by how up­to­date they are.

Get familiar with pacman

pacman is the Arch user's best friend. It is highly recommendedto study and learn how to use the pacman(8) tool. Try:

$ man pacman

Page 66: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 66/85

For more information, have a look at the pacman wiki entry atyour own leisure, or check out the pacman rosetta entry for acomparison to other popular package managers.

Update the System

You are now ready to upgrade your entire system. Before you do,read through the news (and optionally the announce mailing list).Often the developers will provide important information aboutrequired configurations and modifications for known issues.Consulting these pages before any upgrade is good practice.

Sync, refresh, and upgrade your entire new system with:

# pacman -Syu

or:

# pacman --sync --refresh --sysupgrade

pacman will now download a fresh copy of the master packagelist from the server(s) defined in /etc/pacman.conf and perform allavailable upgrades. You may be prompted to upgrade pacmanitself at this point. If so, say yes, and then reissue the pacman -Syu command when finished.

Reboot if a kernel upgrade has occurred.

Note: Occasionally, configuration changes may take placerequiring user action during an update; read pacman's output forany pertinent information.

Page 67: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 67/85

Pacman output is saved in /var/log/pacman.log.

See Package Management FAQs for answers to frequently askedquestions regarding updating and managing your packages.

Ignoring Packages

After executing the command pacman -Syu, the entire systemwill be updated. It is possible to prevent a package from beingupgraded. A typical scenario would be a package for which anupgrade may prove problematic for the system. In this case, thereare two options; indicate the package(s) to skip in the pacmancommand line using the ­­ignore switch ( pacman -S --helpfor details) or permanently indicate the package(s) to skip in the/etc/pacman.conf file in the IgnorePkg array. For moreinformation, please see the pacman wiki entry.

Please note that the power user is expected to keep the system upto date with pacman ­Syu, rather than selectively upgradingpackages. You may diverge from this typical usage as you wish;just be warned that there is a greater chance that things will notwork as intended and that it could break your system. Themajority of complaints happen when selective upgrading, unusualcompilation or improper software installation is performed. Use ofIgnorePkg in /etc/pacman.conf is therefore discouraged, andshould only be used sparingly, if you know what you are doing.

The Arch rolling release model

Page 68: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 68/85

Keep in mind that Arch is a rolling release distribution. Thismeans there is never a reason to reinstall or perform elaboratesystem rebuilds to upgrade to the newest version. Simply issuing pacman -Syu periodically keeps your entire system up­to­dateand on the bleeding edge. At the end of this upgrade, yoursystem is completely current. Remember to reboot if a kernelupgrade has occurred.

Adding a User

Note: Before adding your users, consider hardening your systemby switching from md5 password hashes to sha512 passwordhashes. See the [SHA_password_hashes] wiki article for more.

Linux is a multi­user environment. You should not do youreveryday work using the root account. It is more than poorpractice; it is dangerous. Root is for administrative tasks. Instead,add a normal, non­root, user account using the /usr/sbin/useradd program.

# useradd -m -g [initial_group] -G [additional_groups] -s [login_shell] [username]

­m Creates user home directory as /home/username. Withintheir home directory, a user can write files, delete them,install programs, etc. Users' home directories shall containtheir data and personal configuration files, the so­called 'dotfiles' (their name is preceded by a dot), which are 'hidden'.(To view dotfiles, enable the appropriate option in your filemanager or run ls with the ­a switch.) If there is a conflict

Page 69: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 69/85

between user (under /home/username) and globalconfiguration files, (usually under /etc/) the settings in theuser file will prevail. Dotfiles likely to be altered by the enduser include .xinitrc and .bashrc files. The configuration filesfor xinit and Bash respectively. They allow the user theability to change the window manager to be started uponlogin and also aliases, user­specified commands andenvironment variables respectively. When a user is created,their dotfiles shall be taken from the /etc/skel directorywhere system sample files reside.­g The group name or number of the user's initial logingroup. The group name must exist. If a group number isprovided, it must refer to an already existing group. If notspecified, the behavior of useradd will depend on theUSERGROUPS_ENAB variable contained in/etc/login.defs.­G A list of supplementary groups which the user is also amember of. Each group is separated from the next by acomma, with no intervening spaces. The default is for theuser to belong only to the initial group.­s The path and filename of the user´s default login shell.Arch Linux init scripts use Bash. After the boot process iscomplete, the default login shell is user­specified. (Ensurethe chosen shell package is installed if choosing somethingother than Bash).

Useful groups for your non­root user include:

Page 70: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 70/85

audio ­ for tasks involving sound card and related softwarefloppy ­ for access to a floppy if applicablelp ­ for managing printing tasksoptical ­ for managing tasks pertaining to the optical drive(s)storage ­ for managing storage devicesvideo ­ for video tasks and hardware accelerationwheel ­ for using sudogames ­ needed for write permission for games in the gamesgrouppower ­ used w/ power options (e.g.: shutdown with powerbutton)scanner ­ for using a scanner

A typical desktop system example, adding a user named "archie"specifying bash as the login shell:

# useradd -m -g users -G audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash archie

Next, add a password for your new user using /usr/bin/passwd.

An example for our user, 'archie':

# passwd archie

(You will be prompted to provide the new password.)

Page 71: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 71/85

Your new non­root user has now been created, complete with ahome directory and a login password.

Deleting the user account:

In the event of error, or if you wish to delete this user account infavor of a different name or for any other reason, use /usr/sbin/userdel:

# userdel -r [username]

­r Files in the user´s home directory will be removed alongwith the home directory itself and the user´s mail spool.

If you want to change the name of your user or any existing user,see the Change username page of the Arch wiki and/or theGroups and User Management articles for further information.You may also check the man pages for usermod(8) and gpasswd(8).

Install and setup Sudo (Optional)

Install Sudo:

# pacman -S sudo

To add a user as a sudo user (a "sudoer"), the visudo commandmust be run as root.

Page 72: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 72/85

By default, the visudo command uses the editor vi. If you do notknow how to use vi, you may set the EDITOR environmentvariable to the editor of your choice, such as in this example withthe editor "nano":

# EDITOR=nano visudo

Note: Please note that you are setting the variable and startingvisudo on the same line at the same time. This will not workproperly as two separated commands.

If you are comfortable using vi, issue the visudo commandwithout the EDITOR=nano variable:

# visudo

This will open the file /etc/sudoers in a special session of vi.visudo copies the file to be edited to a temporary file, edits it withan editor, (vi by default), and subsequently runs a sanity check. Ifit passes, the temporary file overwrites the original with thecorrect permissions.

Warning: Do not edit /etc/sudoers directly with an editor; Errorsin syntax can cause annoyances (like rendering the root accountunusable). You must use the visudo command to edit/etc/sudoers.

In the previous section we added your user to the "wheel" group.To give users in the wheel group full root privileges when theyprecede a command with "sudo", uncomment the following line:

Page 73: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 73/85

%wheel ALL=(ALL) ALL

Now you can give any user access to the sudo command bysimply adding them to the wheel group.

For more information, such as sudoer <TAB> completion, seeSudo.

You should now have a completely functional Arch systemwhich will act as a suitable base for you to build upon based onyour needs. However, most people are interested in a desktopsystem, complete with sound and graphics. This part of the guidewill give a quick run down to getting these extras working.

Sound

If you want sound, proceed to Advanced Linux SoundArchitecture for instructions. Alternatively, proceed to the nextsection (installing a GUI) first, and set up sound later (it usuallyworks out of the box, so you'll just need to unmute it).

The Advanced Linux Sound Architecture (ALSA) is includedwith the kernel and it's recommended to try it first. However, if itdoesn't work or you aren't satisfied with the quality, the OpenSound System is a viable alternative. OSSv4 has been releasedunder a free license and is generally considered a significantimprovement over the older OSSv3 which was replaced byALSA. Instructions can be found in the OSS article.

Page 74: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 74/85

If you have advanced audio requirements, take a look at Soundfor an overview of various articles.

Graphical User Interface

Install X

The X Window System (commonly X11, or X) is a networkingand display protocol which provides windowing on bitmapdisplays. It provides the standard toolkit and protocol to buildgraphical user interfaces (GUIs).

Note: If you're installing Arch in a Virtualbox guest, you need adifferent way to complete X installation. See Running Arch Linuxas a guest, then skip the A,B,C steps below.

Now we will install the base Xorg packages using pacman. Thisis the first step in building a GUI.

Install the base packages:

# pacman -S xorg

Install mesa for 3D support:

# pacman -S mesa

The 3D utilities glxgears and glxinfo are included in the mesa­demos package, install if needed:

# pacman -S mesa-demos

Install video driver

Page 75: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 75/85

Next, you should install a driver for your graphics card.

You will need knowledge of which video chipset your machinehas. If you do not know, use the /usr/sbin/lspci program:

$ lspci

Note: The vesa driver is the most generic, and should work withalmost any modern video chipset. If you cannot find a suitabledriver for your video chipset, vesa should work with any videocard, but it offers only slow 2D.

For a complete list of all open­source video drivers, search thepackage database:

$ pacman -Ss xf86-video | less

Note: Proprietary drivers for NVIDIA and ATI are covered in thenext sections. If you plan on doing heavy 3D processing such asgaming, consider using these.

Use pacman to install the appropriate video driver for your videocard/onboard video. Example for the Savage driver:

# pacman -S xf86-video-savage

Tip: For some Intel graphics cards, configuration may benecessary to get proper 2D or 3D performance, see Intel for moreinformation.

NVIDIA Graphics Cards

Page 76: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 76/85

NVIDIA users have three options for drivers (in addition to thevesa driver):

The open­source nouveau driver, which offers fast 2dacceleration and experimental 3d support which is goodenough for basic compositing (note: does not fully supportpowersaving yet). Feature Matrix.The open­source (but obfuscated) nv driver, which is veryslow and only has 2d support.The proprietary nvidia drivers, which offer good 3dperformance and powersaving. Even if you plan on usingthe proprietary drivers, it is recommended to start withnouveau and then switch to the binary driver after you haveX set up and working. Nouveau often works out­of­the­box,while nvidia will require configuration and likely sometroubleshooting. See NVIDIA for more information.

The open­source nouveau driver should be good enough for mostusers and is recommended:

# pacman -S xf86-video-nouveau

Or, for 3D support (experimental):

# pacman -S nouveau-dri

Create the file /etc/X11/xorg.conf.d/20­nouveau.conf, and inputthe following contents:

Section "Device"

Page 77: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 77/85

Identifier "n" Driver "nouveau"EndSection

This is required to ensure that nouveau driver is loaded. Xorgdoes not yet autoload nouveau.

Tip: For advanced instructions, see Nouveau.

ATI Graphics Cards

ATI owners have two options for drivers (in addition to the vesadriver):

The open source radeon driver provided by the xf86­video­ati package. See the radeon feature matrix for details.The proprietary fglrx driver provided by the catalyst packagelocated in the AUR. It supports only newer devices(HD2xxx and newer). It was once a package offered byArch in the extra repository, but as of March 2009,official support has been dropped because of dissatisfactionwith the quality and speed of development of the proprietarydriver. See ATI Catalyst for more information.

The open­source driver is the recommended choice. Install theradeon ATI Driver:

# pacman -S xf86-video-ati

Tip: For advanced instructions, see ATI.

Page 78: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 78/85

Install input drivers

Udev should be capable of detecting your hardware withoutproblems and evdev (xf86­input­evdev) is the modern,hotplugging input driver for almost all devices so in most cases,installing input drivers is not needed. At this point, evdev hasalready been installed as a dependency of Xorg.

If evdev does not support your device, install the needed driverfrom the xorg­input­drivers group.

For a complete list of available input drivers, invoke a pacmansearch:

# pacman -Ss xf86-input | less

Note: You only need xf86­input­keyboard or xf86­input­mouse ifyou plan on disabling hotplugging, otherwise, evdev will act asthe input driver.

Laptop users (or users with a touchscreen) will also need thesynaptics package to allow X to configure thetouchpad/touchscreen:

# pacman -S xf86-input-synaptics

Tip: For instructions on fine tuning or troubleshooting touchpadsettings, see the Touchpad Synaptics article.

Configure X (Optional)

Page 79: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 79/85

Warning: Proprietary drivers usually require a reboot afterinstallation along with configuration. See NVIDIA or ATICatalyst for details.

X Server features auto­configuration and therefore can functionwithout an xorg.conf. If you still wish to manually configure XServer, please see the Xorg wiki page.

Non­US keyboard

If you do not use a standard US keyboard you need to set thekeyboard layout in /etc/X11/xorg.conf.d/10­evdev.conf:

Section "InputClass" Identifier "evdev keyboard catchall" MatchIsKeyboard "on" MatchDevicePath "/dev/input/event*" Driver "evdev" Option "XkbLayout" "be"EndSection

Note: The XkbLayout key may differ from the keymap code youused with the km or loadkeys command. For instance, the uklayout corresponds to the key: gb.

Testing X

This section will explain how to start the very basic graphicalenvironment included with in the xorg group in order to test it.This uses the simple default X window manager, twm.

Page 80: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 80/85

The default X environment is rather bare. This section below willdeal with installing a desktop environment or window manager ofyour choice to supplement X.

If you installed Xorg before creating your regular user, there willbe an empty .xinitrc file in your $HOME that you need to eitherdelete or edit in order for X to start properly. If you do not do thisX will show a blank screen with what appears to be no errors inyour Xorg.0.log. Simply deleting it will get it running with adefault X environment.

$ rm ~/.xinitrc

Message bus

Note: dbus is likely required for many of your applications towork properly, if you know you don't need it, skip this section.

Install dbus:

# pacman -S dbus

To start automatically on boot, you should add dbus to yourDAEMONS array in /etc/rc.conf:

DAEMONS=(syslog-ng dbus network crond)

If you need to start dbus without rebooting, run

# /etc/rc.d/dbus start

Start X

Page 81: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 81/85

Note: The Ctrl­Alt­Backspace shortcut traditionally used to kill Xhas been deprecated and will not work to exit out of this test. Youcan enable Ctrl­Alt­Backspace by editing xorg.conf, as describedhere.

Finally, start Xorg:

$ startx

$ xinit -- /usr/bin/X -nolisten tcp

A few movable windows should show up, and your mouseshould work. Once you are satisfied that X installation was asuccess, you may exit out of X by issuing the exit command intothe prompts until you return to the console.

If the screen goes black, you may still attempt to switch to adifferent virtual console (CTRL­Alt­F2, for example), and loginblindly as root, followed by <Enter>, followed by root's passwordfollowed by <Enter>.

You can attempt to kill the X server with /usr/bin/pkill(note the capital letter X):

# pkill X

If pkill does not work, reboot blindly with:

# reboot

In case of errors

Page 82: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 82/85

If a problem occurs, then look for errors in /var/log/Xorg.0.log.Be on the lookout for any lines beginning with (EE) whichrepresent errors, and also (WW) which are warnings that couldindicate other issues.

$ grep EE /var/log/Xorg.0.log

Errors may also be searched for in the console output of thevirtual console from which X was started.

See the Xorg article for detailed instructions and troubleshooting.

Need Help?

If you are still having trouble after consulting the Xorg article andneed assistance via the Arch forums, be sure to install and usewgetpaste:

# pacman -S wgetpaste

Use wgetpaste and provide links for the following files whenasking for help in your forum post:

~/.xinitrc/etc/X11/xorg.conf/var/log/Xorg.0.log/var/log/Xorg.0.log.old

Use wgetpaste like so:

$ wgetpaste </path/to/file>

Page 83: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 83/85

Post the corresponding links given within your forum post. Besure to provide appropriate hardware and driver information aswell.

Warning: It is very important to provide detail whentroubleshooting X. Please provide all pertinent information asdetailed above when asking for assistance on the Arch forums.

Install Fonts

At this point, you may wish to save time by installing visuallypleasing, true type fonts, before installing a desktopenvironment/window manager. DejaVu is a set of high quality,general­purpose fonts.

Install with:

# pacman -S ttf-dejavu

Refer to Font Configuration for how to configure font renderingand Fonts for font suggestions and installation instructions.

Choose and install a graphical interface

The X Window System provides the basic framework forbuilding a graphical user interface (GUI).

Note: Choosing your DE or WM is a very subjective andpersonal decision. Choose the best environment for your needs.

Window Manager (WM)

Page 84: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 84/85

Controls the placement and appearance of application windowsin conjunction with the X Window System. See Windowmanagers for more information.

Desktop Environment (DE)

Works atop and in conjunction with X, to provide a completelyfunctional and dynamic GUI. A DE typically provides awindow manager, icons, applets, windows, toolbars, folders,wallpapers, a suite of applications and abilities like drag anddrop.See Desktop environments for more information.

Note: You can build your own DE by using a WM and theapplications of your choice.

After installing a graphical interface, you may wish to continuewith General Recommendations for post­installation instructions.

Methods for starting your Graphical Environment

Manually

You might prefer to start X manually from your terminal ratherthan booting straight into the desktop. For DE­specificcommands, please see the wiki page corrosponding to your DEfor more information. For more generic X commands, please seethe section on the Xorg page.

Automatically

Page 85: Arch Linux Beginners' Guide

4/23/13 Beginners' Guide — wiki.archlinux.org — Readability

www.readability.com/articles/3wuojrwx 85/85

You might prefer to have the desktop start automatically duringboot instead of starting X manually. See Display Manager forinstructions on using a login manager or Start X at Boot for twolightweight methods that don't rely on a display manager.

Appendix

For a list of Common Applications and Lightweight Applications,visit their respective articles.

See General Recommendations for post­installation tutorials likesetting up CPU frequency scaling or font rendering.

Original URL:https://wiki.archlinux.org/index.php/Beginners'_Guide