Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(clarify the scope of the article, see Talk:Installation Guide#arch-install-scripts)
(Pre-installation: mention x86_64, see talk)
 
(230 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:About Arch]]
 
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
[[ar:Installation Guide]]
+
[[ar:Installation guide]]
[[cs:Installation Guide]]
+
[[bg:Installation guide]]
 +
[[cs:Installation guide]]
 +
[[da:Installation guide]]
 
[[de:Arch Install Scripts]]
 
[[de:Arch Install Scripts]]
[[el:Installation Guide]]
+
[[el:Installation guide]]
[[es:Installation Guide]]
+
[[es:Installation guide]]
[[fr:Arch_install_scripts]]
+
[[fi:Installation guide]]
[[it:Installation Guide]]
+
[[fr:Arch install scripts]]
[[ko:Installation Guide]]
+
[[hr:Installation guide]]
[[pl:Installation Guide]]
+
[[hu:Installation guide]]
[[pt:Installation Guide]]
+
[[id:Installation guide]]
 +
[[it:Installation guide]]
 +
[[ja:インストールガイド]]
 +
[[ko:Installation guide]]
 +
[[lt:Installation guide]]
 +
[[nl:Installation guide]]
 +
[[pl:Installation guide]]
 +
[[pt:Installation guide]]
 
[[ro:Ghid de instalare]]
 
[[ro:Ghid de instalare]]
[[ru:Installation Guide]]
+
[[ru:Installation guide]]
[[uk:Installation Guide]]
+
[[sk:Installation guide]]
[[zh-CN:Installation Guide]]
+
[[sr:Installation guide]]
[[zh-TW:Installation Guide]]
+
[[th:Installation guide]]
This document will guide you through the process of installing [[Arch Linux]] from the live system booted with the official installation image. Before installing, you are advised to skim over the [[FAQ]]. See [[Beginners' Guide]] for a highly detailed, explanatory installation guide. [[:Category:Getting and installing Arch]] contains several more installation guides for specific cases.
+
[[uk:Installation guide]]
 +
[[zh-cn:Installation guide]]
 +
[[zh-tw:Installation guide]]
 +
This document is a guide for installing [[Arch Linux]] from the live system booted with the official installation image. Before installing, it would be advised to view the [[FAQ]]. For conventions used in this document, see [[Help:Reading]].  
  
The community-maintained [[Main Page|Arch wiki]] is an excellent resource and should be consulted for issues first. The [[Wikipedia:IRC|IRC]] channel (irc://irc.freenode.net/#archlinux), and the [https://bbs.archlinux.org/ forums] are also available if the answer cannot be found elsewhere. Also, be sure to check out the {{ic|man}} pages for any command you are unfamiliar with; this can usually be invoked with {{ic|man ''command''}}.
+
For more detailed instructions, see the respective [[ArchWiki:About|ArchWiki]] articles (accessible from the installation environment with [[ELinks]]), or the various programs' [[man page]]s; see {{man|7|archlinux|url=https://projects.archlinux.org/svntogit/packages.git/tree/filesystem/trunk/archlinux.7.txt}} for an overview of the configuration. For interactive help, the [[IRC channel]] and the [https://bbs.archlinux.org/ forums] are also available.
  
== Download ==
+
== Pre-installation ==
Download the new Arch Linux ISO from the [https://www.archlinux.org/download/ Arch Linux download page].
+
* A single image is provided which can be booted into an i686 and x86_64 live system to install Arch Linux over the network. Media containing the [core] repository are no longer provided.
+
* Install images are signed and it is highly recommended to verify their signature before use: this can be done by downloading the ''.sig'' file from the download page (or one of the mirrors listed there) to the same directory as the ''.iso'' file and then using {{ic|pacman-key -v ''iso-file''.sig}}.
+
* The image can be burned to a CD, mounted as an ISO file, or directly [[USB Installation Media|written to a USB stick]]. It is intended for new installations only; an existing Arch Linux system can always be updated with {{ic|pacman -Syu}}.
+
  
== Installation ==
+
Arch Linux should run on any [[w:P6 (microarchitecture)|i686]] or [[w:X86-64|x86_64]] compatible machine with a minimum of 256 MB RAM. A basic installation with all packages from the {{Grp|base}} group should take less than 800 MB of disk space. The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.
  
=== Keyboard layout ===
+
Download and boot the installation medium as explained in [[:Category:Getting and installing Arch]]. You will be logged in as the root user, and presented with a [[Zsh]] shell prompt; common commands such as {{man|1|systemctl}} can be [[w:Command-line_completion|tab-completed]].
  
For many countries and keyboard types appropriate keymaps are available already, and a command like {{ic|loadkeys uk}} might do what you want. More available keymap files can be found in {{ic|/usr/share/kbd/keymaps/}} (you can omit the keymap path and file extension when using loadkeys).
+
To [[textedit|edit]] configuration files, [[nano#Usage|nano]], [[w:vi|vi]] and [[vim#Usage|vim]] are available.
  
=== Partition disks ===
+
=== Verify the boot mode ===
See [[partitioning]] for details.
+
  
If you want to create any stacked block devices for [[LVM]], [[disk encryption]] or [[RAID]], do it now.
+
If UEFI mode is enabled on an [[UEFI]] motherboard, [[Archiso]] will launch Arch Linux accordingly via [[systemd-boot]]. To verify this, list the [[efivars]] directory:
 +
 
 +
# ls /sys/firmware/efi/efivars
 +
 
 +
If it does not exist, the system is booted in [[w:BIOS|BIOS]] (or CSM) mode.
 +
 
 +
=== Set the keyboard layout ===
 +
 
 +
The default [[Keyboard_configuration_in_console|console keymap]] is [[Wikipedia:File:KB United States-NoAltGr.svg|US]]. Available choices can be listed with {{ic|ls /usr/share/kbd/keymaps/**/*.map.gz}}.
 +
 
 +
The layout can be changed with {{man|1|loadkeys}}, appending a file name (path and file extension can be omitted). For example:
 +
 
 +
# loadkeys ''de-latin1''
 +
 
 +
[[Console fonts]] are located in {{ic|/usr/share/kbd/consolefonts/}}, and can likewise be set with {{man|8|setfont}}.
 +
 
 +
=== Connect to the Internet ===
 +
 
 +
Internet service via [[dhcpcd]] is enabled on boot for supported wired devices; check the connection using a tool such as [[ping]].
 +
 
 +
If a different [[network configuration]] tool is needed, [[systemd-networkd]] and [[netctl]] are available. See {{man|5|systemd.network}} and {{man|5|netctl.profile|url=https://git.archlinux.org/netctl.git/tree/docs/netctl.profile.5.txt}} for examples. When using either service, [[stop]] {{ic|dhcpcd@''interface''.service}} first.
 +
 
 +
=== Update the system clock ===
 +
 
 +
Use {{man|1|timedatectl}} to ensure the system clock is accurate:
 +
 
 +
# timedatectl set-ntp true
 +
 
 +
To check the service status, use {{ic|timedatectl status}}.
 +
 
 +
=== Partition the disks ===
 +
 
 +
To modify and print [[partition table]]s, use:
 +
 
 +
* [[fdisk]] or [[parted]] for both [[MBR]] and [[GPT]], or
 +
* [[gdisk]] for GPT only.
 +
 
 +
At least one partition must be available for the {{ic|/}} directory. [[UEFI]] systems additionally require an [[EFI System Partition]]. Other partitions may be needed, such as a [[GRUB#GUID Partition Table (GPT) specific instructions|GRUB BIOS boot partition]].
 +
 
 +
If wanting to create any stacked block devices for [[LVM]], [[disk encryption]] or [[RAID]], do it now.
  
 
=== Format the partitions ===
 
=== Format the partitions ===
See [[File Systems#Step_2:_create_the_new_file_system|File Systems]] for details.
 
  
If you are using (U)EFI you will most probably need another partition to host the UEFI System partition. Read [[Unified Extensible Firmware Interface#EFI_System_Partition|Create an UEFI System Partition in Linux]].
+
[[File systems]] are created using {{man|8|mkfs}}, or {{man|8|mkswap}} in case of the [[swap]] area. See [[File systems#Create a file system]] for details.
  
 
=== Mount the partitions ===
 
=== Mount the partitions ===
You must now mount the root partition on {{ic|/mnt}}. After that, you should create directories for and mount any other partitions ({{ic|/mnt/boot}}, {{ic|/mnt/home}}, ...)  and mount your [[Swap|swap]] partition if you want them to be detected by {{ic|genfstab}}.
 
  
=== Connect to the internet ===
+
{{man|8|mount}} the root partition on {{ic|/mnt}}, for example:
A DHCP service is already enabled for all available devices. If you need to setup a static IP or use management tools such as [[Netctl]], you should stop this service first: {{ic|systemctl stop dhcpcd.service}}. For more information read [[configuring network]].
+
  
==== Wireless ====
+
# mount /dev/''sda1'' /mnt
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netctl]].
+
  
=== Install the base system ===
+
After that, create directories for and mount any other partitions ({{ic|/mnt/boot}}, {{ic|/mnt/home}}, ...) and activate your ''swap'' partition with {{man|8|swapon}}, if you want them to be detected later by ''genfstab''.
Before installing, you may want to edit {{ic|/etc/pacman.d/mirrorlist}} such that your preferred [[Mirrors|mirror]] is first. This copy of the mirrorlist will be installed on your new system by {{ic|pacstrap}} as well, so it's worth getting it right.
+
 
 +
== Installation ==
 +
 
 +
=== Select the mirrors ===
 +
 
 +
Edit {{ic|/etc/pacman.d/mirrorlist}} and select a download mirror(s). Regional mirrors usually work best; however, other criteria may be necessary to discern, read more on [[Mirrors]].  
 +
 
 +
This file will later be copied to the new system by ''pacstrap'', so it is worth getting right.
 +
 
 +
=== Install the base packages ===
 +
 
 +
Use the [https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in pacstrap] script to install the {{Grp|base}} package group:
  
Using the [https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in pacstrap] script we install the base system.
 
 
 
  # pacstrap /mnt base
 
  # pacstrap /mnt base
  
Other packages can be installed by appending their names to the above command (space seperated), including the boot loader if you want.
+
The group does not include all tools from the live installation, such as {{Pkg|btrfs-progs}} or specific wireless firmware; see [https://projects.archlinux.org/archiso.git/tree/configs/releng/packages.both packages.both] for comparison.  
  
=== Configure the system ===
+
To [[install]] other packages or groups to the new system, append their names to ''pacstrap'' (space separated) or to individual {{man|8|pacman|url=https://www.archlinux.org/pacman/pacman.8.html}} commands after the [[#Chroot]] step.
* Generate an [[fstab]] with the following command (if you prefer to use UUIDs or labels, add the {{ic|-U}} or {{ic|-L}} option, respectively):
+
:{{bc|# genfstab -p /mnt >> /mnt/etc/fstab}}
+
* [[chroot]] into our newly installed system:
+
:{{bc|# arch-chroot /mnt}}
+
* Write your hostname to {{ic|/etc/hostname}}.
+
  
* Symlink {{ic|/etc/localtime}} to {{ic|/usr/share/zoneinfo/Zone/SubZone}}. Replace {{ic|Zone}} and {{ic|Subzone}} to your liking. For example:
+
== Configure the system ==
:{{bc|# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime}}
+
  
* Uncomment the selected locale in {{ic|/etc/locale.gen}} and generate it with {{ic|locale-gen}}.
+
=== Fstab ===
* Set [[Locale#Setting system-wide locale|locale]] preferences in {{ic|/etc/locale.conf}}.
+
* Add [[KEYMAP|console keymap]] and [[Fonts#Console_fonts|font]] preferences in {{ic|/etc/vconsole.conf}}
+
* Configure {{ic|/etc/mkinitcpio.conf}} as needed (see [[mkinitcpio]]) and create an initial RAM disk with:
+
:{{bc|# mkinitcpio -p linux}}
+
  
* Set a root password with {{ic|passwd}}.
+
Generate an [[fstab]] file (use {{ic|-U}} or {{ic|-L}} to define by [[UUID]] or labels):
* Configure the network again for newly installed environment. See [[Network Configuration]] and [[Wireless Setup]].
+
  
=== Install and configure a boot loader ===
+
# genfstab -U /mnt >> /mnt/etc/fstab
See [[Boot Loaders]] for the available choices.
+
  
=== Unmount and reboot ===
+
Check the resulting file in {{ic|/mnt/etc/fstab}} afterwards, and edit it in case of errors.
If you are still in the chroot environment type {{ic|exit}} or press {{ic|Ctrl+D}} in order to exit.
+
Earlier we mounted the partitions under {{ic|/mnt}}. In this step we will unmount them:
+
# umount -R /mnt
+
  
Now reboot and then login into the new system with the root account.
+
=== Chroot ===
  
== Post-installation ==
+
[[Change root]] into the new system:
  
=== User management ===
+
# arch-chroot /mnt
  
Add any user accounts you require besides root, as described in [[Users and Groups#User management|User management]]. It is not good practice to use the root account for regular use, or expose it via [[SSH]] on a server. The root account should only be used for administrative tasks.
+
=== Time zone ===
  
=== Package management ===
+
Set the [[time zone]]:
  
See [[pacman]] and [[FAQ#Package Management]] for answers regarding installing, updating, and managing packages.
+
# ln -s /usr/share/zoneinfo/''zone''/''subzone'' /etc/localtime
  
=== Service management ===
+
Run {{man|8|hwclock}} to generate {{ic|/etc/adjtime}}. If the hardware clock is set to [[w:UTC|UTC]], other operating systems should be [[Time standard|configured accordingly]].
  
Arch Linux uses [[systemd]] as init, 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 {{ic|systemctl}} command. Read [[systemd#Basic systemctl usage]] for more information.
+
# hwclock --systohc --''utc''
  
=== Sound ===
+
=== Locale ===
  
[[ALSA]] usually works out-of-the-box. It just needs to be unmuted. Install {{Pkg|alsa-utils}} (which contains {{ic|alsamixer}}) and follow [[Advanced Linux Sound Architecture#Unmuting the channels|these]] instructions.
+
Uncomment {{ic|en_US.UTF-8 UTF-8}} and other needed [[localization]]s in {{ic|/etc/locale.gen}}, and generate them with:
  
ALSA is included with the kernel and it is recommended. If it does not work, [[OSS]] is a viable alternative. If you have advanced audio requirements, take a look at [[Sound system]] for an overview of various articles.
+
# locale-gen
  
=== Display server ===
+
Set the {{ic|LANG}} [[variable]] in {{man|5|locale.conf}} accordingly, for example:
  
The X Window System (commonly X11, or X) is a networking and display protocol which provides windowing on bitmap displays. It is the de-facto standard for implementating graphical user interfaces. See the [[Xorg]] article for details.
+
# echo LANG=''en_US.UTF-8'' > /etc/locale.conf
  
[[Wayland]] is a new 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.
+
If required, set the [[Keyboard_configuration_in_console|console keymap]] and [[Fonts#Console_fonts|font]] in {{man|5|vconsole.conf}}.
  
=== Fonts ===
+
=== Hostname ===
  
You may wish to install a set of TrueType fonts, as only unscalable bitmap fonts are included by default. DejaVu is a set of high quality, general-purpose fonts with good [[Wikipedia:Unicode|Unicode]] coverage:
+
Create an entry for the [[hostname]] in {{ic|/etc/hostname}}:
  
  # pacman -S ttf-dejavu
+
  # echo ''myhostname'' > /etc/hostname
  
Refer to [[Font Configuration]] for how to configure font rendering and [[Fonts]] for font suggestions and installation instructions.
+
Add a matching line to {{ic|/etc/hosts}}:
  
== Appendix ==
+
127.0.1.1 ''myhostname''.localdomain ''myhostname''
 +
 
 +
=== Network configuration ===
 +
 
 +
Configure the network for the newly installed environment: see [[Network configuration]].
 +
 
 +
For [[Wireless configuration]], [[install]] the {{Pkg|iw}}, {{Pkg|wpa_supplicant}}, and {{Pkg|dialog}} packages, as well as needed [[Wireless#Installing driver/firmware|firmware packages]].
 +
 
 +
=== Initramfs ===
 +
 
 +
When making configuration changes to [[mkinitcpio.conf]], create a new initial RAM disk with:
 +
 
 +
# mkinitcpio -p linux
 +
 
 +
=== Root password ===
 +
 
 +
Set the root [[password]]:
 +
 
 +
# passwd
 +
 
 +
=== Boot loader ===
 +
 
 +
See [[:Category:Boot loaders]] for available choices and configurations. For example, set up the boot loader with [[systemd-boot]] if your system supports UEFI, and [[GRUB#BIOS systems|GRUB]] when not.
 +
 
 +
If you have an Intel CPU, install the {{Pkg|intel-ucode}} package in addition, and [[Microcode#Enabling_Intel_microcode_updates|enable microcode updates]].
 +
 
 +
== Reboot ==
 +
 
 +
Exit the chroot environment by typing {{ic|exit}} or pressing {{ic|Ctrl+D}}.
 +
 
 +
Optionally manually unmount all the partitions with {{ic|umount -R /mnt}}: this allows noticing any "busy" partitions, and finding the cause with {{man|1|fuser}}.
 +
 
 +
Finally, restart the machine by typing {{ic|reboot}}: any partitions still mounted will be automatically unmounted by ''systemd''. Remember to remove the installation media and then login into the new system with the root account.
 +
 
 +
== Post-installation ==
  
For a list of applications that may be of interest, see [[List of Applications]].
+
See [[General recommendations]] for system management directions and post-installation tutorials (like setting up a graphical user interface, sound or a touchpad).
  
See [[General Recommendations]] for post-installation tutorials like setting up a touchpad or font rendering.
+
For a list of applications that may be of interest, see [[List of applications]].

Latest revision as of 06:22, 31 August 2016

This document is a guide for installing Arch Linux from the live system booted with the official installation image. Before installing, it would be advised to view the FAQ. For conventions used in this document, see Help:Reading.

For more detailed instructions, see the respective ArchWiki articles (accessible from the installation environment with ELinks), or the various programs' man pages; see archlinux(7) for an overview of the configuration. For interactive help, the IRC channel and the forums are also available.

Pre-installation

Arch Linux should run on any i686 or x86_64 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. The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.

Download and boot the installation medium as explained in Category:Getting and installing Arch. You will be logged in as the root user, and presented with a Zsh shell prompt; common commands such as systemctl(1) can be tab-completed.

To edit configuration files, nano, vi and vim are available.

Verify the boot mode

If UEFI mode is enabled on an UEFI motherboard, Archiso will launch Arch Linux accordingly via systemd-boot. To verify this, list the efivars directory:

# ls /sys/firmware/efi/efivars

If it does not exist, the system is booted in BIOS (or CSM) mode.

Set the keyboard layout

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

The layout can be changed with loadkeys(1), appending a file name (path and file extension can be omitted). For example:

# loadkeys de-latin1

Console fonts are located in /usr/share/kbd/consolefonts/, and can likewise be set with setfont(8).

Connect to the Internet

Internet service via dhcpcd is enabled on boot for supported wired devices; check the connection using a tool such as ping.

If a different network configuration tool is needed, systemd-networkd and netctl are available. See systemd.network(5) and netctl.profile(5) for examples. When using either service, stop dhcpcd@interface.service first.

Update the system clock

Use timedatectl(1) to ensure the system clock is accurate:

# timedatectl set-ntp true

To check the service status, use timedatectl status.

Partition the disks

To modify and print partition tables, use:

At least one partition must be available for the / directory. UEFI systems additionally require an EFI System Partition. Other partitions may be needed, such as a GRUB BIOS boot partition.

If wanting to create any stacked block devices for LVM, disk encryption or RAID, do it now.

Format the partitions

File systems are created using mkfs(8), or mkswap(8) in case of the swap area. See File systems#Create a file system for details.

Mount the partitions

mount(8) the root partition on /mnt, for example:

# mount /dev/sda1 /mnt 

After that, create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and activate your swap partition with swapon(8), if you want them to be detected later by genfstab.

Installation

Select the mirrors

Edit /etc/pacman.d/mirrorlist and select a download mirror(s). Regional mirrors usually work best; however, other criteria may be necessary to discern, read more on Mirrors.

This file will later be copied to the new system by pacstrap, so it is worth getting right.

Install the base packages

Use the pacstrap script to install the base package group:

# pacstrap /mnt base

The group does not include all tools from the live installation, such as btrfs-progs or specific wireless firmware; see packages.both for comparison.

To install other packages or groups to the new system, append their names to pacstrap (space separated) or to individual pacman(8) commands after the #Chroot step.

Configure the system

Fstab

Generate an fstab file (use -U or -L to define by UUID or labels):

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

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

Chroot

Change root into the new system:

# arch-chroot /mnt

Time zone

Set the time zone:

# ln -s /usr/share/zoneinfo/zone/subzone /etc/localtime

Run hwclock(8) to generate /etc/adjtime. If the hardware clock is set to UTC, other operating systems should be configured accordingly.

# hwclock --systohc --utc

Locale

Uncomment en_US.UTF-8 UTF-8 and other needed localizations in /etc/locale.gen, and generate them with:

# locale-gen

Set the LANG variable in locale.conf(5) accordingly, for example:

# echo LANG=en_US.UTF-8 > /etc/locale.conf

If required, set the console keymap and font in vconsole.conf(5).

Hostname

Create an entry for the hostname in /etc/hostname:

# echo myhostname > /etc/hostname

Add a matching line to /etc/hosts:

127.0.1.1	myhostname.localdomain	myhostname

Network configuration

Configure the network for the newly installed environment: see Network configuration.

For Wireless configuration, install the iw, wpa_supplicant, and dialog packages, as well as needed firmware packages.

Initramfs

When making configuration changes to mkinitcpio.conf, create a new initial RAM disk with:

# mkinitcpio -p linux

Root password

Set the root password:

# passwd

Boot loader

See Category:Boot loaders for available choices and configurations. For example, set up the boot loader with systemd-boot if your system supports UEFI, and GRUB when not.

If you have an Intel CPU, install the intel-ucode package in addition, and enable microcode updates.

Reboot

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

Optionally manually unmount all the partitions with umount -R /mnt: this allows noticing any "busy" partitions, and finding the cause with fuser(1).

Finally, restart the machine by typing reboot: any partitions still mounted will be automatically unmounted by systemd. Remember to remove the installation media and then login into the new system with the root account.

Post-installation

See General recommendations for system management directions and 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.