Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(Post-installation: update after merging content to General recommendations)
(Set the keyboard layout: typo)
 
(75 intermediate revisions by 6 users not shown)
Line 1: Line 1:
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
[[ar:Installation Guide]]
+
[[ar:Installation guide]]
[[cs:Installation Guide]]
+
[[bg:Official 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:Official Installation Guide]]
[[hu:Installation Guide]]
+
[[fr:Arch install scripts]]
[[it:Installation Guide]]
+
[[hu:Installation guide]]
[[ko:Installation Guide]]
+
[[it:Installation guide]]
[[pl:Installation Guide]]
+
[[ja:インストールガイド]]
[[pt:Installation Guide]]
+
[[ko:Installation guide]]
 +
[[lt:Quick Arch Linux Install]]
 +
[[nl:Official 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:Quick Arch Linux Install]]
[[zh-CN:Installation Guide]]
+
[[sr:Official Installation Guide]]
[[zh-TW:Installation Guide]]
+
[[th:Quick Arch Linux Install]]
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]]. If looking for a more detailed installation guide see the [[Beginners' guide]], or [[:Category:Getting and installing Arch]] for specific installation cases.
  
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''}}.
+
Most help can be found on the wiki or through the various programs' [[man page]]s; see [https://projects.archlinux.org/svntogit/packages.git/tree/filesystem/trunk/archlinux.7.txt archlinux(7)] 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 ==
+
Download and boot the installation medium as explained in [[:Category:Getting and installing Arch]], then proceed with the rest of this guide.
  
=== Keyboard layout ===
+
The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.
  
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).
+
=== Set the keyboard layout ===
  
=== Partition disks ===
+
The default keyboard layout is US. Alternative keyboard layouts can be loaded with {{ic|loadkeys ''keymap_file''}}: keymap files can be found in {{ic|/usr/share/kbd/keymaps/}} (path and file extension can be omitted).
See [[partitioning]] for details.  
+
  
If you want to create any stacked block devices for [[LVM]], [[disk encryption]] or [[RAID]], do it now.
+
=== Connect to the Internet ===
  
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]].
+
Internet service via DHCP discovery is enabled on boot for supported wired devices; read more at [[Network configuration]].  For supported wireless devices run {{ic|wifi-menu}} to set up the network; read more with [[Wireless network configuration]].  If needing a static IP or network management tools, stop the DHCP discovery service with {{ic|systemctl stop dhcpcd@''eth0''.service}}, and read [[Netctl]].
 +
 
 +
=== Update the system clock ===
 +
 
 +
See [[systemd-timesyncd]].
 +
 
 +
=== Partition the disks ===
 +
 
 +
See [[Partitioning]] for details; some special partitions may be needed, see [[UEFI#EFI System Partition|EFI System Partition]] and [[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]] and optionally [[Swap]] for details.
+
 
 +
See [[File systems#Create a filesystem|File systems]] and optionally [[Swap]] 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 activate your ''swap'' partition if you want them to be detected by ''genfstab''.
 
  
=== Connect to the internet ===
+
Mount the root partition on {{ic|/mnt}}. After that, create directories for and mount any other partitions ({{ic|/mnt/boot}}, {{ic|/mnt/home}}, ...) and activate your ''swap'' partition if you want them to be detected later by ''genfstab''.
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 ====
+
== Installation ==
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netctl]].
+
  
=== Install the base system ===
+
=== Select the mirrors ===
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.
+
 
 +
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 copy of the {{ic|mirrorlist}} file will later be copied on the new system by ''pacstrap'', so it is worth getting it 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}} 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.
+
Other packages or groups can be installed by appending their names to the above command (space separated), possibly including the boot loader.
  
 
=== Configure the system ===
 
=== Configure the system ===
* 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:
+
Generate an [[fstab]] file (use {{ic|-U}} or {{ic|-L}} to define by UUID or labels):
:{{bc|# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime}}
+
 
 +
# genfstab -p /mnt >> /mnt/etc/fstab
 +
 
 +
[[Change root]] into the new system:
 +
 
 +
# arch-chroot /mnt
 +
 
 +
Set the [[hostname]]:
 +
 
 +
# echo ''computer_name'' > /etc/hostname
 +
 
 +
Set the [[time zone]]:
 +
 
 +
# ln -s /usr/share/zoneinfo/''zone''/''subzone'' /etc/localtime
 +
 
 +
Uncomment the needed [[locale]]s in {{ic|/etc/locale.gen}}, then generate them with:
 +
 
 +
# locale-gen
 +
 
 +
Set locale preferences in {{ic|/etc/locale.conf}} and possibly {{ic|$HOME/.config/locale.conf}}:
 +
 
 +
# echo LANG=''your_locale'' > /etc/locale.conf
 +
 
 +
Add console [[keymap]] and [[Fonts#Console_fonts|font]] preferences in {{ic|/etc/vconsole.conf}}.
 +
 
 +
Configure the network for the newly installed environment: see [[Network configuration]] and [[Wireless network configuration]].
 +
 
 +
Configure [[mkinitcpio|/etc/mkinitcpio.conf]] if additional features are needed. Create a new initial RAM disk with:
 +
 
 +
# mkinitcpio -p linux
 +
 
 +
Set the root password:
 +
 
 +
# passwd
 +
 
 +
=== Install a boot loader ===
  
* Uncomment the selected locale in {{ic|/etc/locale.gen}} and generate it with {{ic|locale-gen}}.
+
See [[Boot loaders]] for the available choices and configuration.
* 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}}.
+
=== Reboot ===
* Configure the network again for newly installed environment. See [[Network Configuration]] and [[Wireless Setup]].
+
  
=== Install and configure a boot loader ===
+
Exit the chroot environment by typing {{ic|exit}} or pressing {{ic|Ctrl+D}}.
See [[Boot Loaders]] for the available choices.
+
  
=== Unmount and reboot ===
+
Optionally manually unmount all the partitions with {{ic|umount -R /mnt}}: this allows noticing any "busy" partitions, and finding the cause with [[Wikipedia:fuser_(Unix)|fuser]].
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.
+
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 ==
 
== Post-installation ==
  
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 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]].
 
For a list of applications that may be of interest, see [[List of applications]].

Latest revision as of 12:42, 23 February 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. If looking for a more detailed installation guide see the Beginners' guide, or Category:Getting and installing Arch for specific installation cases.

Most help can be found on the wiki or through 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

Download and boot the installation medium as explained in Category:Getting and installing Arch, then proceed with the rest of this guide.

The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.

Set the keyboard layout

The default keyboard layout is US. Alternative keyboard layouts can be loaded with loadkeys keymap_file: keymap files can be found in /usr/share/kbd/keymaps/ (path and file extension can be omitted).

Connect to the Internet

Internet service via DHCP discovery is enabled on boot for supported wired devices; read more at Network configuration. For supported wireless devices run wifi-menu to set up the network; read more with Wireless network configuration. If needing a static IP or network management tools, stop the DHCP discovery service with systemctl stop dhcpcd@eth0.service, and read Netctl.

Update the system clock

See systemd-timesyncd.

Partition the disks

See Partitioning for details; some special partitions may be needed, see EFI System Partition and GRUB BIOS boot partition. If wanting to create any stacked block devices for LVM, disk encryption or RAID, do it now.

Format the partitions

See File systems and optionally Swap for details.

Mount the partitions

Mount the root partition on /mnt. After that, create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and activate your swap partition 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 copy of the mirrorlist file will later be copied on the new system by pacstrap, so it is worth getting it right.

Install the base packages

Use the pacstrap script to install the base group:

# pacstrap /mnt base

Other packages or groups can be installed by appending their names to the above command (space separated), possibly including the boot loader.

Configure the system

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

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

Change root into the new system:

# arch-chroot /mnt

Set the hostname:

# echo computer_name > /etc/hostname

Set the time zone:

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

Uncomment the needed locales in /etc/locale.gen, then generate them with:

# locale-gen

Set locale preferences in /etc/locale.conf and possibly $HOME/.config/locale.conf:

# echo LANG=your_locale > /etc/locale.conf

Add console keymap and font preferences in /etc/vconsole.conf.

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

Configure /etc/mkinitcpio.conf if additional features are needed. Create a new initial RAM disk with:

# mkinitcpio -p linux

Set the root password:

# passwd

Install a boot loader

See Boot loaders for the available choices and configuration.

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.

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.