Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(GRUB)
(Configure the system: comply with Help:Style and improve consistency with similar instructions in the guide, reported by User:Rdeckard in the talk page)
 
(150 intermediate revisions by 8 users not shown)
Line 1: Line 1:
[[Category:About Arch]]
 
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
[[cs:Installation Guide]]
+
[[ar: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]]
[[it:Installation Guide]]
+
[[fr:Arch install scripts]]
[[ko:Installation Guide]]
+
[[hu:Installation guide]]
[[pl:Installation Guide]]
+
[[it:Installation guide]]
[[pt:Installation Guide]]
+
[[ja:インストールガイド]]
 +
[[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:Installation guide]]
This document will guide you through the process of installing [[Arch Linux]] using the [https://github.com/falconindy/arch-install-scripts Arch Install Scripts]. Before installing, you are advised to skim over the [[FAQ]].
+
[[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 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 ==
+
Download and boot the installation medium as explained in [[:Category:Getting and installing Arch]], then proceed with the rest of this guide.
  
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).
+
The installation process needs to retrieve packages from a remote repository, therefore a working internet connection is required.
  
== Partition disks ==
+
=== Set the keyboard layout ===
See [[partitioning]] for details.
+
  
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
+
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).
  
== Format the partitions ==
+
=== Connect to the Internet ===
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#Create_an_UEFI_System_Partition_in_Linux|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]] {{ic|dhcpcd@''eth0''.service}} and read [[Netctl]].
  
== Mount the partitions ==
+
=== Update the system clock ===
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 ==
+
See [[systemd-timesyncd]].
A DHCP service is already enabled for all available devices. If you need to setup a static IP or use management tools such as [[Netcfg#Configuration|Netcfg]], you should stop this service first: {{ic|systemctl stop dhcpcd.service}}. For more information read [[configuring network]].
+
  
=== Wireless ===
+
=== Partition the disks ===
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netcfg#Configuration|Netcfg]].
+
  
== Install the base system ==
+
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.
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]].
+
=== Format the partitions ===
+
# 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.
+
See [[File systems#Create a filesystem|File systems]] and optionally [[Swap]] for details.
  
== Install a bootloader ==
+
=== Mount the partitions ===
=== [[GRUB2|GRUB]] ===
+
  
* For BIOS:
+
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''.
  
# arch-chroot /mnt pacman -S grub-bios
+
== Installation ==
  
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
+
=== Select the mirrors ===
  
# arch-chroot /mnt pacman -S grub-efi-x86_64
+
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 GRUB after chrooting (refer to the [[#Configure the system]] section).
+
=== Install the base packages ===
  
=== [[Syslinux|Syslinux]] ===
+
Use the [https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in pacstrap] script to install the {{Grp|base}} group:
+
 
# arch-chroot /mnt pacman -S syslinux
+
# 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 {{ic|-U}} or {{ic|-L}} to define by UUID or labels):
  
== 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):
 
 
  # genfstab -p /mnt >> /mnt/etc/fstab
 
  # genfstab -p /mnt >> /mnt/etc/fstab
Next we [[chroot]] into our newly installed system:
+
 
 +
[[Change root]] into the new system:
 +
 
 
  # arch-chroot /mnt
 
  # arch-chroot /mnt
  
* Write your hostname to {{ic|/etc/hostname}}.
+
[[Create]] the [[/etc/hostname]] file.
* 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
 +
 
 +
Uncomment the needed [[locale]]s in {{ic|/etc/locale.gen}}, then generate them with:
 +
 
 +
# locale-gen
 +
 
 +
Add at least {{ic|1=LANG=''your_locale''}} in {{ic|/etc/locale.conf}} and possibly {{ic|$HOME/.config/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:
  
* 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.
+
Set the root password:
 +
 
 +
# passwd
  
* Set a root password with {{ic|passwd}}.
+
=== Install a boot loader ===
  
== Unmount and reboot ==
+
See [[Boot loaders]] for the available choices and configuration.
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 [[Wikipedia:fuser_(Unix)|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|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|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 05:18, 22 May 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 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

Create the /etc/hostname file.

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

Add at least LANG=your_locale in /etc/locale.conf and possibly $HOME/.config/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.