Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
m (GRUB: update link)
(Install the base packages: pacman(8))
 
(248 intermediate revisions by 10 users not shown)
Line 1: Line 1:
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
[[cs:Installation Guide]]
+
[[ar: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]]
As of the [http://www.archlinux.org/news/install-media-20120715-released/ 2012.07.15 installation media release], AIF (the Arch Installation Framework) is no longer included but instead [https://github.com/falconindy/arch-install-scripts Arch Install Scripts] are provided to aid in the installation process. This article summarizes the install process using these scripts. See the [[Beginners' Guide]] instead for a walkthrough aimed at new users.
+
[[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]].  
  
== Download ==
+
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 {{ic|[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 the new Arch Linux ISO from the [https://www.archlinux.org/download/ Arch Linux download page].
+
* Instead of six different images we only provide a single one 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 recommend to verify their signature before use. On Arch Linux, this can be done by using {{bc|pacman-key -v <iso-file>.sig}}
+
* The image can be burned to a CD, mounted as an ISO file, or directly written to a USB stick using a utility like {{ic|dd}}. It is intended for new installations only; an existing Arch Linux system can always be updated with {{ic|pacman -Syu}}.
+
  
== Keyboard layout ==
+
== Pre-installation ==
  
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).
+
Arch Linux should run on any [[Wikipedia:P6 (microarchitecture)|i686]] 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.
  
== Partition disks ==
+
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]].
See [[partitioning]] for details.
+
  
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
+
To [[edit]] configuration files, [[nano#Usage|nano]], [[w:vi|vi]] and [[vim#Usage|vim]] are available.
  
== Format the partitions ==
+
The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.
See [[Format_a_device#Step_2:_create_the_new_file_system|here]] 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#Create_an_UEFI_System_Partition_in_Linux|this article]].
+
=== Verify the boot mode ===
  
== Mount the partitions ==
+
As instructions differ for [[UEFI]] systems, verify the boot mode by checking [[efivars]]:
We now must mount the root partition on {{ic|/mnt}}. You should also create directories for and mount any other partitions ({{ic|/mnt/boot}}, {{ic|/mnt/home}}, ...) if you want them to be detected by {{ic|genfstab}}.
+
  
== Connect to the internet ==
+
# ls /sys/firmware/efi/efivars
Assuming a wired connection, running {{ic|dhclient}} or {{ic|dhcpcd}} is sufficient to get a lease. For more info visit [[configuring network]].
+
  
=== Wireless ===
+
=== Set the keyboard layout ===
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netcfg#Configuration|Netcfg]].
+
  
== Install the base system ==
+
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}}.
Before installing, you may want to edit {{ic|/etc/pacman.d/mirrorlist}} such that your preferred 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.
+
  
Using the [https://github.com/falconindy/arch-install-scripts/blob/master/pacstrap.in pacstrap] script we install the base system. The ''base-devel'' package group should also be installed if you plan on compiling software from the [[AUR]] or using [[ABS]].
+
The layout can be changed with {{man|1|loadkeys}}, appending a file name (path and file extension can be omitted). For example:
+
# pacstrap /mnt base base-devel
+
  
Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.
+
# loadkeys ''de-latin1''
  
== Install a bootloader ==
+
[[Console fonts]] are located in {{ic|/usr/share/kbd/consolefonts/}}, and can likewise be set with {{man|8|setfont}}.
=== [[GRUB2|GRUB]] ===
+
  
* For BIOS:
+
=== Connect to the Internet ===
  
# pacstrap /mnt grub-bios
+
Internet service via [[dhcpcd]] is enabled on boot for supported wired devices; check the connection using a tool such as {{man|8|ping}}.
  
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
+
For other [[network configuration]], {{man|8|systemd-networkd}} and {{ic|[https://git.archlinux.org/netctl.git/tree/docs/netctl.1.txt netctl(1)]}} are available. See {{man|5|systemd.network}} and {{ic|[https://git.archlinux.org/netctl.git/tree/docs/netctl.profile.5.txt netctl.profile(5)]}} for examples.
  
# pacstrap /mnt grub-efi-x86_64
+
When using either service, [[stop]] {{ic|dhcpcd@''interface''.service}}:
  
* Install GRUB after chrooting (refer to the [[#Configure the system]] section).
+
# systemctl stop dhcpcd@''interface''.service
  
=== [[Syslinux|Syslinux]] ===
+
=== Update the system clock ===
+
 
  # pacstrap /mnt syslinux
+
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 {{man|8|fdisk}} or {{man|8|parted}} for both [[MBR]] and [[GPT]], or {{ic|[http://www.rodsbooks.com/gdisk/gdisk.html gdisk(8)]}} 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 ===
 +
 
 +
See [[File systems#Create a file system|File systems]] and optionally [[Swap]] for details.
 +
 
 +
=== Mount the partitions ===
 +
 
 +
{{man|8|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 with {{man|8|swapon}}, if you want them to be detected later by ''genfstab''.
 +
 
 +
== 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}} group:
 +
 
 +
  # pacstrap /mnt base
 +
 
 +
To [[install]] other packages or groups to the new system, such as {{Pkg|btrfs-progs}} or a [[boot loader]], append their names to ''pacstrap'' (space separated) or to individual {{ic|[https://www.archlinux.org/pacman/pacman.8.html pacman(8)]}} commands after [[#Chroot|changing root]].
  
 
== 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):
+
 
 +
=== Fstab ===
 +
 
 +
Generate an {{man|5|fstab}} file (use {{ic|-U}} or {{ic|-L}} to define by [[UUID]] or labels):
 +
 
 
  # genfstab -p /mnt >> /mnt/etc/fstab
 
  # genfstab -p /mnt >> /mnt/etc/fstab
Next we [[chroot]] into our newly installed system:
+
 
 +
Check the resulting file in {{ic|/mnt/etc/fstab}} afterwards, and edit it in case of errors.
 +
 
 +
=== Chroot ===
 +
 
 +
[[Change root]] into the new system:
 +
 
 
  # arch-chroot /mnt
 
  # arch-chroot /mnt
  
* Write your hostname to {{ic|/etc/hostname}}.
+
=== Time zone ===
* Symlink {{ic|/etc/localtime}} to {{ic|/usr/share/zoneinfo/Zone/SubZone}}. Replace {{ic|Zone}} and {{ic|Subzone}} to your liking. For example:
+
  
  # ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
+
Set the [[time zone]]:
 +
 
 +
  # ln -s /usr/share/zoneinfo/''zone''/''subzone'' /etc/localtime
 +
 
 +
Run {{man|8|hwclock}} to generate {{ic|/etc/adjtime}}. If the [[time standard]] is set to [[w:UTC|UTC]], other operating systems should be configured accordingly.
 +
 
 +
# hwclock --systohc --''utc''
 +
 
 +
=== Locale ===
 +
 
 +
Uncomment the needed [[locale]]s in {{ic|/etc/locale.gen}}, then generate them with:
 +
 
 +
# locale-gen
 +
 
 +
Add {{ic|1=LANG=''your_locale''}} to {{man|5|locale.conf}}, and if required, [[Keyboard_configuration_in_console|console keymap]] and [[Fonts#Console_fonts|font]] to {{man|5|vconsole.conf}}.
 +
 
 +
=== Hostname ===
 +
 
 +
Create an entry for your [[hostname]] in {{ic|/etc/hostname}} and {{ic|/etc/hosts}}. See {{man|5|hostname}} and {{man|5|hosts}}.
 +
 
 +
=== 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:
  
* Set [[Locale#Setting system-wide locale|locale]] preferences in {{ic|/etc/locale.conf}}.
 
* Add [[KEYMAP|console keymap and font]] preferences in {{ic|/etc/vconsole.conf}}
 
* Uncomment the selected locale in {{ic|/etc/locale.gen}} and generate it with {{ic|locale-gen}}.
 
* Configure {{ic|/etc/mkinitcpio.conf}} as needed (see [[mkinitcpio]]) and create an initial RAM disk with:
 
 
 
  # mkinitcpio -p linux
 
  # mkinitcpio -p linux
  
* Configure the bootloader: refer back to the appropriate article from the bootloader installation section.
+
=== Root password ===
 +
 
 +
Set the root [[password]]:
 +
 
 +
# passwd
 +
 
 +
=== Boot loader ===
  
* Set a root password with {{ic|passwd}}.
+
See [[:Category:Boot loaders]] for available choices and configurations. Choices include [[GRUB]] (BIOS/UEFI), [[systemd-boot]] (UEFI) and [[syslinux]] (BIOS).
  
== Unmount and reboot ==
+
If you have an Intel CPU, in addition to installing a boot loader, install the {{Pkg|intel-ucode}} package and [[Microcode#Enabling_Intel_microcode_updates|enable microcode updates]].
If you are still in the chroot environment type {{ic|exit}} or press {{keypress|Ctrl+D}} in order to exit.
+
Earlier we mounted the partitions under {{ic|/mnt}}. In this step we will unmount them:
+
# umount /mnt/{boot,home,}
+
  
Now reboot and then login into the new system with the root account.
+
== Reboot ==
  
== Configure pacman ==
+
Exit the chroot environment by typing {{ic|exit}} or pressing {{ic|Ctrl+D}}.
Edit {{ic|/etc/pacman.conf}} and configure pacman's options, also enabling the repositories you need.
+
  
See [[Pacman]] and [[Official Repositories]] for details.
+
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}}.
  
== Update the system ==
+
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.
At this point you should update your system.
+
  
See [[Pacman#Upgrading packages]] for instructions.
+
== Post-installation ==
  
== Add a user ==
+
See [[General recommendations]] for system management directions and post-installation tutorials (like setting up a graphical user interface, sound or a touchpad).
Finally, add a normal user as described in [[Users and Groups#User management]].
+
  
Your new Arch Linux base system is now a functional GNU/Linux environment: you can proceed to [[Beginners' Guide/Extra]] for customization suggestions.
+
For a list of applications that may be of interest, see [[List of applications]].

Latest revision as of 12:29, 25 July 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 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.

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.

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

Verify the boot mode

As instructions differ for UEFI systems, verify the boot mode by checking efivars:

# ls /sys/firmware/efi/efivars

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(8).

For other network configuration, systemd-networkd(8) and netctl(1) are available. See systemd.network(5) and netctl.profile(5) for examples.

When using either service, stop dhcpcd@interface.service:

# systemctl stop dhcpcd@interface.service

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 fdisk(8) or parted(8) for both MBR and GPT, or gdisk(8) for GPT only.

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

See File systems and optionally Swap for details.

Mount the partitions

mount(8) the root partition on /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 group:

# pacstrap /mnt base

To install other packages or groups to the new system, such as btrfs-progs or a boot loader, append their names to pacstrap (space separated) or to individual pacman(8) commands after changing root.

Configure the system

Fstab

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

# genfstab -p /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 time standard is set to UTC, other operating systems should be configured accordingly.

# hwclock --systohc --utc

Locale

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

# locale-gen

Add LANG=your_locale to locale.conf(5), and if required, console keymap and font to vconsole.conf(5).

Hostname

Create an entry for your hostname in /etc/hostname and /etc/hosts. See hostname(5) and hosts(5).

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. Choices include GRUB (BIOS/UEFI), systemd-boot (UEFI) and syslinux (BIOS).

If you have an Intel CPU, in addition to installing a boot loader, install the intel-ucode package 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.