Difference between revisions of "Beginners' guide old"

From ArchWiki
Jump to: navigation, search
(Extra renamed)
m (using more familiar word for non-native English speakers)
Line 28: Line 28:
 
[[zh-CN:Beginners' Guide]]
 
[[zh-CN:Beginners' Guide]]
 
[[zh-TW:Beginners' Guide]]
 
[[zh-TW: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 '''[[Beginners' Guide/Preparation|here]]'''.}}
+
{{Tip|This guide is also available in multiple pages, rather than one large copy. If you would rather read it that way, please start '''[[Beginners' Guide/Preparation|here]]'''.}}
 
{{Article summary start}}
 
{{Article summary start}}
 
{{Article summary text|Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.}}
 
{{Article summary text|Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.}}

Revision as of 03:26, 13 May 2013

Tip: This guide is also available in multiple pages, rather than one large copy. If you would rather read it that way, please start here.
Summary help replacing me
Provides a highly detailed, explanatory guide to installing, configuring and using a full-featured Arch Linux system.
Related
Category:Accessibility
Installation Guide
Network Installation Guide
Install from SSH
General Recommendations
General Troubleshooting

This document will guide you through the process of installing Arch Linux using the Arch Install Scripts. Before installing, you are advised to skim over the FAQ.

The community-maintained ArchWiki is the primary resource that should be consulted if issues arise. The IRC channel (irc://irc.freenode.net/#archlinux) and the forums are also excellent resources if an answer cannot be found elsewhere. In accordance with the Arch Way, you are encouraged to type man command to read the man page of any command you are unfamiliar with.

Contents

Preparation

Arch Linux should run on any i686 compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the base group should take less than 800 MB of disk space.

See Category:Getting and installing Arch for instructions on downloading the installation medium, and methods for booting it to the target machine(s). This guide assumes you use the latest available version.

Boot the installation medium

Point the current boot device to the drive containing the Arch installation media. This is typically achieved by pressing a key during the POST phase, as indicated on the splash screen. Refer to your motherboard's manual for details.

When the Arch menu appears, select Boot Arch Linux and press Enter to enter the installation environment. See README.bootparams for a list of boot parameters.

You will be logged in as the root user and presented with a Zsh shell prompt. Zsh provides advanced tab completion and other features as part of the grml config. For modifying or creating configuration files, typically in /etc, nano and vim are suggested.

UEFI mode

In case you have a UEFI motherboard with UEFI mode enabled, the CD/USB will automatically launch Arch Linux via systemd-boot.

To verify you are booted in UEFI mode, check that the following directory is populated:

# ls /sys/firmware/efi/efivars

See UEFI#UEFI Variables for details.

Set the keyboard layout

The default console keymap is set to us. Available choices can be listed with ls /usr/share/kbd/keymaps/**/*.map.gz.

Note: localectl list-keymaps does not work due to bug FS#46725.

For example, to change the layout to de-latin1, run:

# loadkeys de-latin1

If certain characters appear as white squares or other symbols, change the console font. For example:

# setfont lat9w-16

Connect to the Internet

Wired

The dhcpcd daemon is enabled on boot for wired devices, and will attempt to start a connection. To access captive portal login forms, use the ELinks browser.

Verify a connection was established, for example with ping. If none is available, proceed to configure the network; the examples below use netctl to this purpose. To prevent conflicts, stop the dhcpcd service (replacing enp0s25 with the correct wired interface):

# systemctl stop dhcpcd@enp0s25.service

Interfaces can be listed using ip link, or iw dev for wireless devices. They are prefixed with en (ethernet), wl (WLAN), or ww (WWAN).

Wireless

List available networks, and make a connection for a specified interface:

# wifi-menu -o wlp2s0

The resulting configuration file is stored in /etc/netctl. For networks which require both a username and password, see WPA2 Enterprise#netctl.

Other

Several example profiles, such as for configuring a static IP address, are available. Copy the required one to /etc/netctl, for example ethernet-static:

# cp /etc/netctl/examples/ethernet-static /etc/netctl

Adjust the copy as needed, and enable it:

# netctl start ethernet-static

Update the system clock

Use systemd-timesyncd to ensure that your system clock is accurate. To start it:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

Prepare the storage devices

Warning:
  • In general, partitioning or formatting will make existing data inaccessible and subject to being overwritten, i.e. destroyed, by subsequent operations. For this reason, all data that needs to be preserved must be backed up before proceeding.
  • If dual-booting with an existing installation of Windows on a UEFI/GPT system, avoid reformatting the UEFI partition, as this includes the Windows .efi file required to boot it. Furthermore, Arch must follow the same firmware boot mode and partitioning combination as Windows. See Dual boot with Windows#Important information.

In this step, the storage devices that will be used by the new system will be prepared. Read Partitioning for a more general overview.

Users intending to create stacked block devices for LVM, disk encryption or RAID, should keep those instructions in mind when preparing the partitions. If intending to install to a USB flash key, see Installing Arch Linux on a USB key.

Identify the devices

The first step is to identify the devices where the new system will be installed. The following command will show all the available devices:

# lsblk

This will list all devices connected to your system along with their partition schemes, including that used to host and boot live Arch installation media (e.g. a USB drive). Not all devices listed will therefore be viable or appropriate mediums for installation. Results ending in rom, loop or airoot can be ignored.

Devices (e.g. hard disks) will be listed as sdx, where x is a lower-case letter starting from a for the first device (sda), b for the second device (sdb), and so on. Existing partitions on those devices will be listed as sdxY, where Y is a number starting from 1 for the first partition, 2 for the second, and so on. In the example below, only one device is available (sda), and that device has only one partition (sda1):

NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0    80G  0 disk
└─sda1            8:1    0    80G  0 part

The sdxY convention will be used in the examples provided below for partition tables, partitions, and file systems. As they are just examples, it is important to ensure that any necessary changes to device names, partition numbers, and/or partition sizes (etc.) are made. Do not just blindly copy and paste the commands.

If the existing partition scheme does not need to be changed, skip to #Format the file systems and enable swap, otherwise continue reading the following section.

Partition table types

If you are installing alongside an existing installation (i.e. dual-booting), a partition table will already be in use. If the devices are not partitioned, or the current partitions table or scheme needs to be changed, you will first have to determine the partition tables (one for each device) in use or to be used.

There are two types of partition table:

Any existing partition table can be identified with the following command for each device:

# parted /dev/sdx print

Partitioning tools

Warning: Using a partitioning tool that is incompatible with your partition table type will likely result in the destruction of that table, along with any existing partitions/data.

For each device to be partitioned, a proper tool must be chosen according to the partition table to be used. Several partitioning tools are provided by the Arch installation medium, including:

  • parted: GPT and MBR
  • fdisk, cfdisk, sfdisk: GPT and MBR
  • gdisk, cgdisk, sgdisk: GPT

Devices may also be partitioned before booting the installation media, for example through tools such as GParted (also provided as a live CD).

Using parted in interactive mode

All the examples provided below make use of parted, as it can be used for both UEFI/GPT and BIOS/MBR. It will be launched in interactive mode, which simplifies the partitioning process and reduces unnecessary repetition by automatically applying all partitioning commands to the specified device.

In order to start operating on a device, execute:

# parted /dev/sdx

You will notice that the command-line prompt changes from a hash (#) to (parted): this also means that the new prompt is not a command to be manually entered when running the commands in the examples.

To see a list of the available commands, enter:

(parted) help

When finished, or if wishing to implement a partition table or scheme for another device, exit from parted with:

(parted) quit

After exiting, the command-line prompt will change back to #.

Create new partition table

You need to (re)create the partition table of a device when it has never been partitioned before, or when you want to change the type of its partition table. Recreating the partition table of a device is also useful when the partition scheme needs to be restructured from scratch.

Open each device whose partition table must be (re)created with:

# parted /dev/sdx

To then create a new GPT partition table for UEFI systems, use the following command:

(parted) mklabel gpt

To create a new MBR/msdos partition table for BIOS systems instead, use:

(parted) mklabel msdos

Partition schemes

You can decide the number and size of the partitions the devices should be split into, and which directories will be used to mount the partitions in the installed system (also known as mount points). The mapping from partitions to directories is the partition scheme, which must comply with the following requirements:

  • At least a partition for the / (root) directory must be created.
  • When using a UEFI motherboard, one EFI System Partition must be created.

In the examples below it is assumed that a new and contiguous partitioning scheme is applied to a single device. Some optional partitions will also be created for the /boot and /home directories which otherwise would simply be contained in the / partition. See the Arch filesystem hierarchy for an explanation of the purpose of the various directories. Also the creation of an optional partiton for swap space will be illustrated.

If not already open in a parted interactive session, open each device to be partitioned with:

# parted /dev/sdx

The following command will be used to create partitions:

(parted) mkpart part-type fs-type start end
  • part-type is one of primary, extended or logical, and is meaningful only for MBR partition tables.
  • fs-type is an identifier chosen among those listed by entering help mkpart as the closest match to the file system that you will use in #Format the file systems and enable swap. The mkpart command does not actually create the file system: the fs-type parameter will simply be used by parted to set a 1-byte code that is used by boot loaders to "preview" what kind of data is found in the partition, and act accordingly if necessary. See also Wikipedia:Disk partitioning#PC partition types.
Tip: Most Linux native file systems map to the same partition code (0x83), so it is perfectly safe to e.g. use ext2 for an ext4-formatted partition.
  • start is the beginning of the partition from the start of the device. It consists of a number followed by a unit, for example 1M means start at 1MiB.
  • end is the end of the partition from the start of the device (not from the start value). It has the same syntax as start, for example 100% means end at the end of the device (use all the remaining space).
Warning: It is important that the partitions do not overlap each other: if you do not want to leave unused space in the device, make sure that each partition starts where the previous one ends.
Note: parted may issue a warning like:
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?
In this case, read Partitioning#Partition alignment and follow GNU Parted#Alignment to fix it.

The following command will be used to flag the partition that contains the /boot directory as bootable:

(parted) set partition boot on
  • partition is the number of the partition to be flagged (see the output of the print command).

UEFI/GPT examples

In every instance, a special bootable EFI System Partition is required.

If creating a new EFI System Partition, use the following commands (a size of 512MiB is suggested):

(parted) mkpart ESP fat32 1MiB 513MiB
(parted) set 1 boot on

The remaining partition scheme is entirely up to you. For one other partition using 100% of remaining space:

(parted) mkpart primary ext4 513MiB 100%

For separate / (20GiB) and /home (all remaining space) partitions:

(parted) mkpart primary ext4 513MiB 20.5GiB
(parted) mkpart primary ext4 20.5GiB 100%

And for separate / (20GiB), swap (4GiB), and /home (all remaining space) partitions:

(parted) mkpart primary ext4 513MiB 20.5GiB
(parted) mkpart primary linux-swap 20.5GiB 24.5GiB
(parted) mkpart primary ext4 24.5GiB 100%

BIOS/MBR examples

For a minimum single primary partition using all available disk space, the following command would be used:

(parted) mkpart primary ext4 1MiB 100%
(parted) set 1 boot on

In the following instance, a 20GiB / partition will be created, followed by a /home partition using all the remaining space:

(parted) mkpart primary ext4 1MiB 20GiB
(parted) set 1 boot on
(parted) mkpart primary ext4 20GiB 100%

In the final example below, separate /boot (100MiB), / (20GiB), swap (4GiB), and /home (all remaining space) partitions will be created:

(parted) mkpart primary ext4 1MiB 100MiB
(parted) set 1 boot on
(parted) mkpart primary ext4 100MiB 20GiB
(parted) mkpart primary linux-swap 20GiB 24GiB
(parted) mkpart primary ext4 24GiB 100%

Format the file systems and enable swap

Once the partitions have been created, each must be formatted with an appropriate file system, except for swap partitions. All available partitions on the intended installation device can be listed with the following command:

# lsblk /dev/sdx

With the exceptions noted below, it is recommended to use the ext4 file system:

# mkfs.ext4 /dev/sdxY

If a swap partition has been created, it must be set up and activated with:

# mkswap /dev/sdxY
# swapon /dev/sdxY

Mount the root partition to the /mnt directory of the live system:

# mount /dev/sdxY /mnt

Remaining partitions (except swap) may be mounted in any order, after creating the respective mount points. For example, when using a /boot partition:

# mkdir -p /mnt/boot
# mount /dev/sdxZ /mnt/boot

If a new UEFI system partition has been created on a UEFI/GPT system, it must be formatted with a fat32 file system:

# mkfs.fat -F32 /dev/sdxY

/mnt/boot is also recommended for mounting the (formatted or already existing) EFI System Partition on a UEFI/GPT system. See EFISTUB and related articles for alternatives.

Installation

Select the mirrors

Packages to be installed must be downloaded from mirror servers, which are defined in /etc/pacman.d/mirrorlist. On the live system, all mirrors are enabled, and sorted by their synchronization status and speed at the time the installation image was created.

The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account. See Mirrors for details.

pacstrap will also install a copy of this file to the new system, so it is worth getting right.

Install the base packages

The pacstrap script installs the base system. To build packages from the AUR or with ABS, the base-devel group is also required.

Not all tools from the live installation (see packages.both) are part of the base group. Packages can later be installed with pacman, or by appending their names to the pacstrap command.

# pacstrap -i /mnt base base-devel

The -i switch ensures prompting before package installation.

Configuration

fstab

Generate an fstab file. The -U option indicates UUIDs: see Persistent block device naming. Labels can be used instead through the -L option.

# genfstab -U /mnt >> /mnt/etc/fstab

Check the resulting file in /mnt/etc/fstab afterwards, and edit it in case of errors.

Change root

Copy netctl profiles in /etc/netctl to the new system in /mnt (when applicable), then chroot to it:

# arch-chroot /mnt /bin/bash

Locale

The Locale defines which language the system uses, and other regional considerations such as currency denomination, numerology, and character sets.

Possible values are listed in /etc/locale.gen. Uncomment en_US.UTF-8 UTF-8, as well as other needed localisations. Save the file, and generate the new locales:

# locale-gen

Create /etc/locale.conf, where LANG refers to the first column of an uncommented entry in /etc/locale.gen:

/etc/locale.conf
LANG=en_US.UTF-8

If you set the keyboard layout, make the changes persistent in /etc/vconsole.conf. For example, if de-latin1 was set with loadkeys, and lat9w-16 with setfont, assign the KEYMAP and FONT variables accordingly:

/etc/vconsole.conf
KEYMAP=de-latin1
FONT=lat9w-16

Time

Select a time zone:

# tzselect

Create the symbolic link /etc/localtime, where Zone/Subzone is the TZ value from tzselect:

# ln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtime

It is recommended to adjust the time skew, and set the time standard to UTC:

# hwclock --systohc --utc

If other operating systems are installed on the machine, they must be configured accordingly. See Time for details.

Initramfs

As mkinitcpio was run on installation of linux with pacstrap, most users can use the defaults provided in mkinitcpio.conf.

For special configurations, set the correct hooks in /etc/mkinitcpio.conf and re-generate the initramfs image:

# mkinitcpio -p linux

Install a boot loader

See Boot loaders for available choices and configurations. If you have an Intel CPU, install the intel-ucode package, and enable microcode updates.

UEFI/GPT

Here, the installation drive is assumed to be GPT-partioned, and have the EFI System Partition (gdisk type EF00, formatted with FAT32) mounted at /boot.

Install systemd-boot to the EFI system partition:

# bootctl install

When successful, create a boot entry as described in systemd-boot#Configuration (replacing $esp with /boot), or adapt the examples in /usr/share/systemd/bootctl/.

BIOS/MBR

Install the grub package. To search for other operating systems, also install os-prober:

# pacman -S grub os-prober

Install the bootloader to the drive Arch was installed to:

# grub-install --target=i386-pc /dev/sda

Generate grub.cfg:

# grub-mkconfig -o /boot/grub/grub.cfg

See GRUB for more information.

Configure the network

The procedure is similar to #Connect to the Internet, except made persistent for subsequent boots. Select one daemon to handle the network.

Hostname

Set the hostname to your liking by adding myhostname to the following file, where myhostname is the hostname you wish to set:

/etc/hostname
myhostname

It is recommended to append the same hostname to localhost entries in /etc/hosts. See Network configuration#Set the hostname for details.

Wired

When only requiring a single wired connection, enable the dhcpcd service:

# systemctl enable dhcpcd@interface.service

Where interface is an ethernet device name.

See Network configuration#Configure the IP address for other available methods.

Wireless

Install iw, wpa_supplicant, and (for wifi-menu) dialog:

# pacman -S iw wpa_supplicant dialog

Additional firmware packages may also be required.

If you used wifi-menu priorly, repeat the steps after finishing the rest of this installation and rebooting, to prevent conflicts with the existing processes.

See Netctl and Wireless#Wireless management for more information.

Root password

Set the root password with:

# passwd

Unmount the partitions and reboot

Exit from the chroot environment by running exit or pressing Ctrl+D.

Partitions will be unmounted automatically by systemd on shutdown. You may however unmount manually as a safety measure:

# umount -R /mnt

If the partition is "busy", you can find the cause with fuser. Reboot the computer.

# reboot

Remove the installation media, or you may boot back into it. You can log into your new installation as root, using the password you specified with passwd.

Post-installation

Your new Arch Linux base system is now a functional GNU/Linux environment ready to be built into whatever you wish or require for your purposes. You are now strongly advised to read the General recommendations article, especially the first two sections. Its other sections provide links to post-installation tutorials like setting up a graphical user interface, sound or a touchpad.

For a list of applications that may be of interest, see List of applications.

This document will guide you through the process of installing Arch Linux using the Arch Install Scripts. Before installing, you are advised to skim over the FAQ.

The community-maintained ArchWiki is the primary resource that should be consulted if issues arise. The IRC channel (irc://irc.freenode.net/#archlinux) and the forums are also excellent resources if an answer cannot be found elsewhere. In accordance with the Arch Way, you are encouraged to type man command to read the man page of any command you are unfamiliar with.

Preparation

Arch Linux should run on any i686 compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the base group should take less than 800 MB of disk space.

See Category:Getting and installing Arch for instructions on downloading the installation medium, and methods for booting it to the target machine(s). This guide assumes you use the latest available version.

Boot the installation medium

Point the current boot device to the drive containing the Arch installation media. This is typically achieved by pressing a key during the POST phase, as indicated on the splash screen. Refer to your motherboard's manual for details.

When the Arch menu appears, select Boot Arch Linux and press Enter to enter the installation environment. See README.bootparams for a list of boot parameters.

You will be logged in as the root user and presented with a Zsh shell prompt. Zsh provides advanced tab completion and other features as part of the grml config. For modifying or creating configuration files, typically in /etc, nano and vim are suggested.

UEFI mode

In case you have a UEFI motherboard with UEFI mode enabled, the CD/USB will automatically launch Arch Linux via systemd-boot.

To verify you are booted in UEFI mode, check that the following directory is populated:

# ls /sys/firmware/efi/efivars

See UEFI#UEFI Variables for details.

Set the keyboard layout

The default console keymap is set to us. Available choices can be listed with ls /usr/share/kbd/keymaps/**/*.map.gz.

Note: localectl list-keymaps does not work due to bug FS#46725.

For example, to change the layout to de-latin1, run:

# loadkeys de-latin1

If certain characters appear as white squares or other symbols, change the console font. For example:

# setfont lat9w-16

Connect to the Internet

Wired

The dhcpcd daemon is enabled on boot for wired devices, and will attempt to start a connection. To access captive portal login forms, use the ELinks browser.

Verify a connection was established, for example with ping. If none is available, proceed to configure the network; the examples below use netctl to this purpose. To prevent conflicts, stop the dhcpcd service (replacing enp0s25 with the correct wired interface):

# systemctl stop dhcpcd@enp0s25.service

Interfaces can be listed using ip link, or iw dev for wireless devices. They are prefixed with en (ethernet), wl (WLAN), or ww (WWAN).

Wireless

List available networks, and make a connection for a specified interface:

# wifi-menu -o wlp2s0

The resulting configuration file is stored in /etc/netctl. For networks which require both a username and password, see WPA2 Enterprise#netctl.

Other

Several example profiles, such as for configuring a static IP address, are available. Copy the required one to /etc/netctl, for example ethernet-static:

# cp /etc/netctl/examples/ethernet-static /etc/netctl

Adjust the copy as needed, and enable it:

# netctl start ethernet-static

Update the system clock

Use systemd-timesyncd to ensure that your system clock is accurate. To start it:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

Prepare the storage devices

Warning:
  • In general, partitioning or formatting will make existing data inaccessible and subject to being overwritten, i.e. destroyed, by subsequent operations. For this reason, all data that needs to be preserved must be backed up before proceeding.
  • If dual-booting with an existing installation of Windows on a UEFI/GPT system, avoid reformatting the UEFI partition, as this includes the Windows .efi file required to boot it. Furthermore, Arch must follow the same firmware boot mode and partitioning combination as Windows. See Dual boot with Windows#Important information.

In this step, the storage devices that will be used by the new system will be prepared. Read Partitioning for a more general overview.

Users intending to create stacked block devices for LVM, disk encryption or RAID, should keep those instructions in mind when preparing the partitions. If intending to install to a USB flash key, see Installing Arch Linux on a USB key.

Identify the devices

The first step is to identify the devices where the new system will be installed. The following command will show all the available devices:

# lsblk

This will list all devices connected to your system along with their partition schemes, including that used to host and boot live Arch installation media (e.g. a USB drive). Not all devices listed will therefore be viable or appropriate mediums for installation. Results ending in rom, loop or airoot can be ignored.

Devices (e.g. hard disks) will be listed as sdx, where x is a lower-case letter starting from a for the first device (sda), b for the second device (sdb), and so on. Existing partitions on those devices will be listed as sdxY, where Y is a number starting from 1 for the first partition, 2 for the second, and so on. In the example below, only one device is available (sda), and that device has only one partition (sda1):

NAME            MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda               8:0    0    80G  0 disk
└─sda1            8:1    0    80G  0 part

The sdxY convention will be used in the examples provided below for partition tables, partitions, and file systems. As they are just examples, it is important to ensure that any necessary changes to device names, partition numbers, and/or partition sizes (etc.) are made. Do not just blindly copy and paste the commands.

If the existing partition scheme does not need to be changed, skip to #Format the file systems and enable swap, otherwise continue reading the following section.

Partition table types

If you are installing alongside an existing installation (i.e. dual-booting), a partition table will already be in use. If the devices are not partitioned, or the current partitions table or scheme needs to be changed, you will first have to determine the partition tables (one for each device) in use or to be used.

There are two types of partition table:

Any existing partition table can be identified with the following command for each device:

# parted /dev/sdx print

Partitioning tools

Warning: Using a partitioning tool that is incompatible with your partition table type will likely result in the destruction of that table, along with any existing partitions/data.

For each device to be partitioned, a proper tool must be chosen according to the partition table to be used. Several partitioning tools are provided by the Arch installation medium, including:

  • parted: GPT and MBR
  • fdisk, cfdisk, sfdisk: GPT and MBR
  • gdisk, cgdisk, sgdisk: GPT

Devices may also be partitioned before booting the installation media, for example through tools such as GParted (also provided as a live CD).

Using parted in interactive mode

All the examples provided below make use of parted, as it can be used for both UEFI/GPT and BIOS/MBR. It will be launched in interactive mode, which simplifies the partitioning process and reduces unnecessary repetition by automatically applying all partitioning commands to the specified device.

In order to start operating on a device, execute:

# parted /dev/sdx

You will notice that the command-line prompt changes from a hash (#) to (parted): this also means that the new prompt is not a command to be manually entered when running the commands in the examples.

To see a list of the available commands, enter:

(parted) help

When finished, or if wishing to implement a partition table or scheme for another device, exit from parted with:

(parted) quit

After exiting, the command-line prompt will change back to #.

Create new partition table

You need to (re)create the partition table of a device when it has never been partitioned before, or when you want to change the type of its partition table. Recreating the partition table of a device is also useful when the partition scheme needs to be restructured from scratch.

Open each device whose partition table must be (re)created with:

# parted /dev/sdx

To then create a new GPT partition table for UEFI systems, use the following command:

(parted) mklabel gpt

To create a new MBR/msdos partition table for BIOS systems instead, use:

(parted) mklabel msdos

Partition schemes

You can decide the number and size of the partitions the devices should be split into, and which directories will be used to mount the partitions in the installed system (also known as mount points). The mapping from partitions to directories is the partition scheme, which must comply with the following requirements:

  • At least a partition for the / (root) directory must be created.
  • When using a UEFI motherboard, one EFI System Partition must be created.

In the examples below it is assumed that a new and contiguous partitioning scheme is applied to a single device. Some optional partitions will also be created for the /boot and /home directories which otherwise would simply be contained in the / partition. See the Arch filesystem hierarchy for an explanation of the purpose of the various directories. Also the creation of an optional partiton for swap space will be illustrated.

If not already open in a parted interactive session, open each device to be partitioned with:

# parted /dev/sdx

The following command will be used to create partitions:

(parted) mkpart part-type fs-type start end
  • part-type is one of primary, extended or logical, and is meaningful only for MBR partition tables.
  • fs-type is an identifier chosen among those listed by entering help mkpart as the closest match to the file system that you will use in #Format the file systems and enable swap. The mkpart command does not actually create the file system: the fs-type parameter will simply be used by parted to set a 1-byte code that is used by boot loaders to "preview" what kind of data is found in the partition, and act accordingly if necessary. See also Wikipedia:Disk partitioning#PC partition types.
Tip: Most Linux native file systems map to the same partition code (0x83), so it is perfectly safe to e.g. use ext2 for an ext4-formatted partition.
  • start is the beginning of the partition from the start of the device. It consists of a number followed by a unit, for example 1M means start at 1MiB.
  • end is the end of the partition from the start of the device (not from the start value). It has the same syntax as start, for example 100% means end at the end of the device (use all the remaining space).
Warning: It is important that the partitions do not overlap each other: if you do not want to leave unused space in the device, make sure that each partition starts where the previous one ends.
Note: parted may issue a warning like:
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel?
In this case, read Partitioning#Partition alignment and follow GNU Parted#Alignment to fix it.

The following command will be used to flag the partition that contains the /boot directory as bootable:

(parted) set partition boot on
  • partition is the number of the partition to be flagged (see the output of the print command).

UEFI/GPT examples

In every instance, a special bootable EFI System Partition is required.

If creating a new EFI System Partition, use the following commands (a size of 512MiB is suggested):

(parted) mkpart ESP fat32 1MiB 513MiB
(parted) set 1 boot on

The remaining partition scheme is entirely up to you. For one other partition using 100% of remaining space:

(parted) mkpart primary ext4 513MiB 100%

For separate / (20GiB) and /home (all remaining space) partitions:

(parted) mkpart primary ext4 513MiB 20.5GiB
(parted) mkpart primary ext4 20.5GiB 100%

And for separate / (20GiB), swap (4GiB), and /home (all remaining space) partitions:

(parted) mkpart primary ext4 513MiB 20.5GiB
(parted) mkpart primary linux-swap 20.5GiB 24.5GiB
(parted) mkpart primary ext4 24.5GiB 100%

BIOS/MBR examples

For a minimum single primary partition using all available disk space, the following command would be used:

(parted) mkpart primary ext4 1MiB 100%
(parted) set 1 boot on

In the following instance, a 20GiB / partition will be created, followed by a /home partition using all the remaining space:

(parted) mkpart primary ext4 1MiB 20GiB
(parted) set 1 boot on
(parted) mkpart primary ext4 20GiB 100%

In the final example below, separate /boot (100MiB), / (20GiB), swap (4GiB), and /home (all remaining space) partitions will be created:

(parted) mkpart primary ext4 1MiB 100MiB
(parted) set 1 boot on
(parted) mkpart primary ext4 100MiB 20GiB
(parted) mkpart primary linux-swap 20GiB 24GiB
(parted) mkpart primary ext4 24GiB 100%

Format the file systems and enable swap

Once the partitions have been created, each must be formatted with an appropriate file system, except for swap partitions. All available partitions on the intended installation device can be listed with the following command:

# lsblk /dev/sdx

With the exceptions noted below, it is recommended to use the ext4 file system:

# mkfs.ext4 /dev/sdxY

If a swap partition has been created, it must be set up and activated with:

# mkswap /dev/sdxY
# swapon /dev/sdxY

Mount the root partition to the /mnt directory of the live system:

# mount /dev/sdxY /mnt

Remaining partitions (except swap) may be mounted in any order, after creating the respective mount points. For example, when using a /boot partition:

# mkdir -p /mnt/boot
# mount /dev/sdxZ /mnt/boot

If a new UEFI system partition has been created on a UEFI/GPT system, it must be formatted with a fat32 file system:

# mkfs.fat -F32 /dev/sdxY

/mnt/boot is also recommended for mounting the (formatted or already existing) EFI System Partition on a UEFI/GPT system. See EFISTUB and related articles for alternatives.

Installation

Select the mirrors

Packages to be installed must be downloaded from mirror servers, which are defined in /etc/pacman.d/mirrorlist. On the live system, all mirrors are enabled, and sorted by their synchronization status and speed at the time the installation image was created.

The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account. See Mirrors for details.

pacstrap will also install a copy of this file to the new system, so it is worth getting right.

Install the base packages

The pacstrap script installs the base system. To build packages from the AUR or with ABS, the base-devel group is also required.

Not all tools from the live installation (see packages.both) are part of the base group. Packages can later be installed with pacman, or by appending their names to the pacstrap command.

# pacstrap -i /mnt base base-devel

The -i switch ensures prompting before package installation.

Configuration

fstab

Generate an fstab file. The -U option indicates UUIDs: see Persistent block device naming. Labels can be used instead through the -L option.

# genfstab -U /mnt >> /mnt/etc/fstab

Check the resulting file in /mnt/etc/fstab afterwards, and edit it in case of errors.

Change root

Copy netctl profiles in /etc/netctl to the new system in /mnt (when applicable), then chroot to it:

# arch-chroot /mnt /bin/bash

Locale

The Locale defines which language the system uses, and other regional considerations such as currency denomination, numerology, and character sets.

Possible values are listed in /etc/locale.gen. Uncomment en_US.UTF-8 UTF-8, as well as other needed localisations. Save the file, and generate the new locales:

# locale-gen

Create /etc/locale.conf, where LANG refers to the first column of an uncommented entry in /etc/locale.gen:

/etc/locale.conf
LANG=en_US.UTF-8

If you set the keyboard layout, make the changes persistent in /etc/vconsole.conf. For example, if de-latin1 was set with loadkeys, and lat9w-16 with setfont, assign the KEYMAP and FONT variables accordingly:

/etc/vconsole.conf
KEYMAP=de-latin1
FONT=lat9w-16

Time

Select a time zone:

# tzselect

Create the symbolic link /etc/localtime, where Zone/Subzone is the TZ value from tzselect:

# ln -s /usr/share/zoneinfo/Zone/SubZone /etc/localtime

It is recommended to adjust the time skew, and set the time standard to UTC:

# hwclock --systohc --utc

If other operating systems are installed on the machine, they must be configured accordingly. See Time for details.

Initramfs

As mkinitcpio was run on installation of linux with pacstrap, most users can use the defaults provided in mkinitcpio.conf.

For special configurations, set the correct hooks in /etc/mkinitcpio.conf and re-generate the initramfs image:

# mkinitcpio -p linux

Install a boot loader

See Boot loaders for available choices and configurations. If you have an Intel CPU, install the intel-ucode package, and enable microcode updates.

UEFI/GPT

Here, the installation drive is assumed to be GPT-partioned, and have the EFI System Partition (gdisk type EF00, formatted with FAT32) mounted at /boot.

Install systemd-boot to the EFI system partition:

# bootctl install

When successful, create a boot entry as described in systemd-boot#Configuration (replacing $esp with /boot), or adapt the examples in /usr/share/systemd/bootctl/.

BIOS/MBR

Install the grub package. To search for other operating systems, also install os-prober:

# pacman -S grub os-prober

Install the bootloader to the drive Arch was installed to:

# grub-install --target=i386-pc /dev/sda

Generate grub.cfg:

# grub-mkconfig -o /boot/grub/grub.cfg

See GRUB for more information.

Configure the network

The procedure is similar to #Connect to the Internet, except made persistent for subsequent boots. Select one daemon to handle the network.

Hostname

Set the hostname to your liking by adding myhostname to the following file, where myhostname is the hostname you wish to set:

/etc/hostname
myhostname

It is recommended to append the same hostname to localhost entries in /etc/hosts. See Network configuration#Set the hostname for details.

Wired

When only requiring a single wired connection, enable the dhcpcd service:

# systemctl enable dhcpcd@interface.service

Where interface is an ethernet device name.

See Network configuration#Configure the IP address for other available methods.

Wireless

Install iw, wpa_supplicant, and (for wifi-menu) dialog:

# pacman -S iw wpa_supplicant dialog

Additional firmware packages may also be required.

If you used wifi-menu priorly, repeat the steps after finishing the rest of this installation and rebooting, to prevent conflicts with the existing processes.

See Netctl and Wireless#Wireless management for more information.

Root password

Set the root password with:

# passwd

Unmount the partitions and reboot

Exit from the chroot environment by running exit or pressing Ctrl+D.

Partitions will be unmounted automatically by systemd on shutdown. You may however unmount manually as a safety measure:

# umount -R /mnt

If the partition is "busy", you can find the cause with fuser. Reboot the computer.

# reboot

Remove the installation media, or you may boot back into it. You can log into your new installation as root, using the password you specified with passwd.

Post-installation

Your new Arch Linux base system is now a functional GNU/Linux environment ready to be built into whatever you wish or require for your purposes. You are now strongly advised to read the General recommendations article, especially the first two sections. Its other sections provide links to post-installation tutorials like setting up a graphical user interface, sound or a touchpad.

For a list of applications that may be of interest, see List of applications.

This document is an annotated index of popular articles and important information for improving and adding functionalities to the installed Arch system. Readers are assumed to have read and followed the Beginners' guide or Installation guide to obtain a basic Arch Linux installation. Having read and understood the concepts explained in #System administration and #Package management is required for following the other sections of this page and the other articles in the wiki.

System administration

This section deals with administrative tasks and system management. For more, please see Core utilities and Category:System administration.

Users and groups

A new installation leaves you with only the superuser account, better known as "root". Logging in as root for prolonged periods of time, possibly even exposing it via SSH on a server, is insecure. Instead, you should create and use unprivileged user account(s) for most tasks, only using the root account for system administration. See Users and groups#User management for details.

Users and groups are a mechanism for access control; administrators may fine-tune group membership and ownership to grant or deny users and services access to system resources. Read the Users and groups article for details and potential security risks.

Privilege escalation

The su (substitute user) command allows you to assume the identity of another user on the system (usually root) from an existing login, whereas the sudo (substitute user do) command grants temporary privilege escalation for a specific command.

Service management

Arch Linux uses systemd as the init process, which is a system and service manager for Linux. For maintaining your Arch Linux installation, it is a good idea to learn the basics about it. Interaction with systemd is done through the systemctl command. Read systemd#Basic systemctl usage for more information.

System maintenance

Arch is a rolling release system and has rapid package turnover, so users have to take some time to do system maintenance. Read Security for recommendations and best practices on hardening the system.

Package management

This section contains helpful information related to package management. For more, please see FAQ#Package management and Category:Package management.

Note: It is imperative to keep up to date with changes in Arch Linux that require manual intervention before upgrading your system. Subscribe to the arch-announce mailing list or check the front page Arch news every time before you update. Alternatively, you may find it useful to subscribe to this RSS feed or follow @archlinux on Twitter.

pacman

pacman is the Arch Linux package manager: all users are required to become familiar with it before reading any other articles.

See pacman tips for suggestions on how to improve your interaction with pacman and package management in general.

Repositories

See Official repositories for details about the purpose of each officially maintained repository.

If you installed Arch Linux x86_64 and plan on using 32-bit applications, you will want to enable the multilib repository.

Unofficial user repositories lists several other unsupported repositories.

Mirrors

Visit Mirrors for steps on taking full advantage of using the fastest and most up to date pacman mirrors. As explained in the article, a particularly good advice is to routinely check the Mirror Status page and/or Mirror-Status for a list of mirrors that have been recently synced.

Arch Build System

Ports is a system initially used by BSD distributions consisting of build scripts that reside in a directory tree on the local system. Simply put, each port contains a script within a directory intuitively named after the installable third-party application.

The ABS tree offers the same functionality by providing build scripts called PKGBUILDs, which are populated with information for a given piece of software; integrity hashes, project URL, version, license and build instructions. These PKGBUILDs are later parsed by makepkg, the actual program that generates packages cleanly manageable by pacman.

Every package in the repositories along with those present in the AUR are subject to recompilation with makepkg.

Arch User Repository

While the ABS tree allows the ability of building software available in the official repositories, the Arch User Repository (AUR) is the equivalent for user submitted packages. It is an unsupported repository of build scripts accessible through the web interface or by an AUR helper.

Booting

This section contains information pertaining to the boot process. An overview of the Arch boot process can be found at Arch boot process. For more, please see Category:Boot process.

Hardware auto-recognition

Hardware should be auto-detected by udev during the boot process by default. A potential improvement in boot time can be achieved by disabling module auto-loading and specifying required modules manually, as described in Kernel modules. Additionally, Xorg should be able to auto-detect required drivers using udev, but users have the option to configure the X server manually too.

Microcode

Processors may have faulty behaviour, which the kernel can correct by updating the microcode on startup. Intel processors require a separate package to this effect. See Microcode for details.

Retaining boot messages

Once it concludes, the screen is cleared and the login prompt appears, leaving users unable to gather feedback from the boot process. Disable clearing of boot messages to overcome this limitation.

Num Lock activation

Num Lock is a toggle key found in most keyboards. For activating Num Lock's number key-assignment during startup, see Activating Numlock on Bootup.

Graphical user interface

This section provides orientation for users wishing to run graphical applications on their system. See Category:X server for additional resources.

Display server

Xorg is the public, open-source implementation of the X Window System (commonly X11, or X). It is required for running applications with graphical user interfaces (GUIs), and the majority of users will want to install it.

Wayland is a new, alternative display server protocol and the Weston reference implementation is available. There is very little support for it from applications at this early stage of development.

Display drivers

The default vesa display driver will work with most video cards, but performance can be significantly improved and additional features harnessed by installing the appropriate driver for ATI, Intel, or NVIDIA products.

Desktop environments

Although Xorg provides the basic framework for building a graphical environment, additional components may be considered necessary for a complete user experience. Desktop environments such as GNOME, KDE, LXDE, and Xfce bundle together a wide range of X clients, such as a window manager, panel, file manager, terminal emulator, text editor, icons, and other utilities. Users with less experience may wish to install a desktop environment for a more familiar environment. See Category:Desktop environments for additional resources.

Window managers

A full-fledged desktop environment provides a complete and consistent graphical user interface, but tends to consume a considerable amount of system resources. Users seeking to maximize performance or otherwise simplify their environment may opt to install a window manager alone and hand-pick desired extras. Most desktop environments allow use of an alternative window manager as well. Dynamic, stacking, and tiling window managers differ in their handling of window placement.

Display manager

Most desktop environment include a display manager for automatically starting the graphical environment and managing user logins. Users without a desktop environment can install one separately. Alternatively you may start X at login as a simple alternative to a display manager.

Power management

This section may be of use to laptop owners or users otherwise seeking power management controls. For more, please see Category:Power management.

See Power management for more general overview.

ACPI events

Users can configure how the system reacts to ACPI events such as pressing the power button or closing a laptop's lid. For the new (recommended) method using systemd, see Power management with systemd. For the old method, see acpid.

CPU frequency scaling

Modern processors can decrease their frequency and voltage to reduce heat and power consumption. Less heat leads to more quiet system and prolongs the life of hardware. See CPU frequency scaling for details.

Laptops

For articles related to portable computing along with model-specific installation guides, please see Category:Laptops. For a general overview of laptop-related articles and recommendations, see Laptop.

Suspend and Hibernate

See main article: Suspend and hibernate.

Multimedia

Category:Multimedia includes additional resources.

Sound

Sound is provided by kernel sound drivers:

  • ALSA is included with the kernel and is recommended because usually it works out of the box (it just needs to be unmuted).
  • OSS is a viable alternative in case ALSA does not work.

Users may additionally wish to install and configure a sound server such as PulseAudio. For advanced audio requirements, see professional audio.

Browser plugins

For access to certain web content, browser plugins such as Adobe Acrobat Reader, Adobe Flash Player, and Java can be installed.

Codecs

Codecs are utilized by multimedia applications to encode or decode audio or video streams. In order to play encoded streams, users must ensure an appropriate codec is installed.

Networking

This section is confined to small networking procedures. Head over to Network configuration for a full guide. For more, please see Category:Networking.

Clock synchronization

The Network Time Protocol (NTP) is a protocol for synchronizing the clocks of computer systems over packet-switched, variable-latency data networks. See Time#Time synchronization for implementations of such protocol.

DNS security

For better security while browsing web, paying online, connecting to SSH services and similar tasks consider using DNSSEC-enabled client software which can validate signed DNS records, and DNSCrypt to encrypt DNS traffic.

Setting up a firewall

A firewall can provide an extra layer of protection on top of the Linux networking stack. While the stock Arch kernel is capable of using Netfilter's iptables, it is not enabled by default. It is highly recommended to set up some form of firewall, see Firewalls for the available guides.

Resource sharing

To share files among the machines in a network, follow the NFS or the SSHFS article.

Use Samba to join a Windows network. To configure the machine to use Active Directory for authentication, read Active Directory Integration.

See also Category:Network sharing.

Input devices

This section contains popular input device configuration tips. For more, please see Category:Input devices.

Keyboard layouts

Non-English or otherwise non-standard keyboards may not function as expected by default. The necessary steps to configure the keymap are different for virtual console and Xorg, they are described in Keyboard configuration in console and Keyboard configuration in Xorg respectively.

Mouse buttons

Owners of advanced or unusual mice may find that not all mouse buttons are recognized by default, or may wish to assign different actions for extra buttons. Instructions can be found in All Mouse Buttons Working.

Laptop touchpads

Many laptops use Synaptics or ALPS "touchpad" pointing devices. These, and several other touchpad models, use the Synaptics input driver; see Touchpad Synaptics for installation and configuration details.

TrackPoints

See the TrackPoint article to configure your TrackPoint device.

Optimization

This section aims to summarize tweaks, tools and available options useful to improve system and application performance.

Benchmarking

Benchmarking is the act of measuring performance and comparing the results to another system's results or a widely accepted standard through a unified procedure.

Maximizing performance

The Maximizing performance article gathers information and is a basic rundown about gaining performance in Arch Linux.

Solid state drives

The Solid State Drives article covers many aspects of solid state drives, including configuring them to maximize their lifetimes.

System service

This section relates to daemons. For more, please see Category:Daemons and system services.

File index and search

Most distributions have a locate command available to be able to quickly search for files. To get this functionality in Arch Linux, mlocate is the recommended install. After the install you should run updatedb to index the filesystems.

Local mail delivery

A default base setup bestows no means for mail syncing. To configure Postfix for simple local mailbox delivery, see Postfix. Other options are SSMTP, msmtp and fdm.

Printing

CUPS is a standards-based, open source printing system developed by Apple. See Category:Printers for printer-specific articles.

Appearance

This section contains frequently-sought "eye candy" tweaks for an aesthetically pleasing Arch experience. For more, please see Category:Eye candy.

Fonts

You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included in a basic Arch system. The ttf-dejavu package provides a set of high quality, general-purpose fonts with good Unicode coverage.

A plethora of information on the subject can be found in the Fonts and Font configuration articles.

If spending a significant amount of time working from the virtual console (i.e. outside an X server), users may wish to change the console font to improve readability; see Fonts#Console fonts.

GTK and Qt themes

A big part of the applications with a graphical interface for Linux systems are based on the GTK+ or the Qt toolkits. See those articles and Uniform look for Qt and GTK applications for ideas to improve the appearance of your installed programs and adapt it to your liking.

Console improvements

This section applies to small modifications that better console programs' practicality. For more, please see Category:Command shells.

Aliases

Aliasing a command, or a group thereof, is a way of saving time when using the console. This is specially helpful for repetitive tasks that do not need significant alteration to their parameters between executions. Common time-saving aliases can be found in Bash#Aliases, which are easily portable to zsh as well.

Alternative shells

Bash is the shell that is installed by default in an Arch system. The live installation media, however, uses zsh with the grml-zsh-config addon package. See Command-line shell#List of shells for more alternatives.

Bash additions

A list of miscellaneous Bash settings, including completion enhancements, history search and Readline macros is available in Bash#Tips and tricks.

Colored output

Even though a number of applications have built-in color capabilities, using a general-purpose colorizing wrapper, such as cope-gitAUR, is another route.

Colorizing the output of specific core utilities such as grep and ls is covered in the Core utilities article.

Man pages (or manual pages) are one of the most useful resources available to GNU/Linux users. To aid readability, the pager can be configured to render colored text as explained in man page#Colored man pages.

Compressed files

Compressed files, or archives, are frequently encountered on a GNU/Linux system. Tar is one of the most commonly used archiving tools, and users should be familiar with its syntax (Arch Linux packages, for example, are simply xzipped tarballs). See Bash/Functions for other helpful commands.

Console prompt

The console prompt (PS1) can be customized to a great extent. See Color Bash Prompt or Zsh#Prompts if using Bash or Zsh, respectively.

Emacs shell

Emacs is known for featuring options beyond the duties of regular text editing, one of these being a full shell replacement. Consult Emacs#Colored output issues for a fix regarding garbled characters that may result from enabling colored output.

Mouse support

Using a mouse with the console for copy-paste operations can be preferred over GNU Screen's traditional copy mode. Refer to Console mouse support for comprehensive directions.

Scrollback buffer

To be able to save and view text which has scrolled off the screen, refer to Scrollback buffer.

Session management

Using terminal multiplexers like tmux or GNU Screen, programs may be run under sessions composed of tabs and panes that can be detached at will, so when the user either kills the terminal emulator, terminates X, or logs off, the programs associated with the session will continue to run in the background as long as the terminal multiplexer server is active. Interacting with the programs requires reattaching to the session.