Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(Install the base system: no need for base-devel here)
m (Partition the disks: fix link as reported in talk page)
 
(131 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}}.
+
  
== 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.
+
  
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
+
=== Connect to the Internet ===
  
=== Format the partitions ===
+
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]].
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]].
+
=== Update the system clock ===
  
=== Mount the partitions ===
+
See [[systemd-timesyncd]].
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 ===
+
=== Partition the disks ===
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 ====
+
See [[Partitioning]] for details; some special partitions may be needed, see [[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.
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netcfg#Configuration|Netcfg]].
+
  
=== Install the base system ===
+
=== Format the partitions ===
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.
+
See [[File systems#Create a filesystem|File systems]] and optionally [[Swap]] for details.
+
# pacstrap /mnt base
+
  
Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.
+
=== Mount the partitions ===
  
=== Install a bootloader ===
+
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''.
==== [[GRUB2|GRUB]] ====
+
  
* For BIOS:
+
== Installation ==
  
# arch-chroot /mnt pacman -S grub-bios
+
=== Select the mirrors ===
  
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
+
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.
  
# arch-chroot /mnt pacman -S grub-efi-x86_64
+
=== Install the base packages ===
  
* Install GRUB after chrooting (refer to the [[#Configure the system]] section).
+
Use the [https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in pacstrap] script to install the {{Grp|base}} group:
  
==== [[Syslinux|Syslinux]] ====
+
  # pacstrap /mnt base
+
 
  # arch-chroot /mnt pacman -S syslinux
+
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):
 
# genfstab -p /mnt >> /mnt/etc/fstab
 
Next we [[chroot]] into our newly installed system:
 
# arch-chroot /mnt
 
  
* Write your hostname to {{ic|/etc/hostname}}.
+
Generate an [[fstab]] file (use {{ic|-U}} or {{ic|-L}} to define by UUID or labels):
* 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
+
  # genfstab -p /mnt >> /mnt/etc/fstab
  
* Set [[Locale#Setting system-wide locale|locale]] preferences in {{ic|/etc/locale.conf}}.
+
[[Change root]] into the new system:
* 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
+
  
* Configure the bootloader: refer back to the appropriate article from the bootloader installation section.
+
# arch-chroot /mnt
  
* Set a root password with {{ic|passwd}}.
+
[[Create]] the [[/etc/hostname]] file.
  
=== Unmount and reboot ===
+
Set the [[time zone]]:
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.
+
# ln -s /usr/share/zoneinfo/''zone''/''subzone'' /etc/localtime
  
== Post-installation ==
+
Uncomment the needed [[locale]]s in {{ic|/etc/locale.gen}}, then generate them with:
  
=== User management ===
+
# locale-gen
  
Add any user accounts you require as as described in [[Users and Groups#User management|User management]]. It isn't 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.
+
Add at least {{ic|1=LANG=''your_locale''}} in {{ic|/etc/locale.conf}} and possibly {{ic|$HOME/.config/locale.conf}}.
  
=== Package management ===
+
Add console [[keymap]] and [[Fonts#Console_fonts|font]] preferences in {{ic|/etc/vconsole.conf}}.
  
See [[pacman]] and [[FAQ#Package Management]] for answers regarding installing, updating, and managing packages.
+
Configure the network for the newly installed environment: see [[Network configuration]] and [[Wireless network configuration]].
  
=== Service management ===
+
Configure [[mkinitcpio|/etc/mkinitcpio.conf]] if additional features are needed. Create a new initial RAM disk with:
  
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.
+
# mkinitcpio -p linux
  
=== Sound ===
+
Set the root password:
  
[[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.
+
# passwd
  
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.
+
=== Install a boot loader ===
  
=== Video driver ===
+
See [[Boot loaders]] for the available choices and configuration.
  
The Linux kernel includes open-source video drivers and support for hardware accelerated framebuffers. However, userland support is required for OpenGL and 2D acceleration in X11.
+
=== Reboot ===
  
If you don't know which video chipset is available on your machine, run:
+
Exit the chroot environment by typing {{ic|exit}} or pressing {{ic|Ctrl+D}}.
  
$ lspci | grep VGA
+
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]].
  
For a complete list of open-source video drivers, search the package database:
+
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.
  
$ pacman -Ss xf86-video | less
+
== Post-installation ==
 
+
The {{ic|vesa}} driver is a generic mode-setting driver that will work with almost every GPU, but will not provide any 2D or 3D acceleration. If a better driver cannot be found or fails to load, Xorg will fall back to vesa. To install it:
+
 
+
# pacman -S xf86-video-vesa
+
 
+
In order for video acceleration to work, and often to expose all the modes that the GPU can set, a proper video driver is required:
+
 
+
{| class="wikitable"  style="text-align:center"
+
|-
+
! Brand !! Type !! Driver !! [[Multilib]] Package<br><span style="font-weight: normal;">(for 32-bit applications on Arch x86_64)</span> !! Documentation
+
|-
+
| rowspan="2" bgcolor=#f7e3e3| '''<span style="color: #e62c2c;">AMD/ATI</span>'''
+
| Open source || {{Pkg|xf86-video-ati}} || {{Pkg|lib32-ati-dri}} || [[ATI]]
+
|-
+
| Proprietary || {{Pkg|catalyst-dkms}} || {{Pkg|lib32-catalyst-utils}} || [[AMD Catalyst]]
+
|-
+
| bgcolor=#e3ecf7| '''<span style="color: #2a6dc8;">Intel</span>'''
+
| Open source
+
| {{Pkg|xf86-video-intel}} || {{Pkg|lib32-intel-dri}} || [[Intel Graphics]]
+
|-
+
| rowspan="4" bgcolor=#e3f7e6| '''<span style="color: #409044;">Nvidia</span>'''
+
| rowspan="2"| Open source
+
| {{Pkg|xf86-video-nouveau}} || {{Pkg|lib32-nouveau-dri}} || [[Nouveau]]
+
|-
+
| {{Pkg|xf86-video-nv}} || – || (legacy driver)
+
|-
+
| rowspan="2"| Proprietary || {{Pkg|nvidia}} || {{Pkg|lib32-nvidia-utils}} || rowspan="2"| [[NVIDIA]]
+
|-
+
| {{Pkg|nvidia-304xx}} || {{Pkg|lib32-nvidia-304xx-utils}}
+
|}
+
 
+
=== Display server ===
+
 
+
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.
+
 
+
[[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.
+
 
+
=== Fonts ===
+
 
+
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:
+
 
+
# pacman -S ttf-dejavu
+
 
+
Refer to [[Font Configuration]] for how to configure font rendering and [[Fonts]] for font suggestions and installation instructions.
+
 
+
== Appendix ==
+
  
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 16:04, 24 June 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.