Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(Video driver: display servers)
(Download: clarify as suggested in User talk:Kynikos#Minor Installation Page Edit)
(20 intermediate revisions by 3 users not shown)
Line 15: Line 15:
 
[[zh-CN:Installation Guide]]
 
[[zh-CN:Installation Guide]]
 
[[zh-TW:Installation Guide]]
 
[[zh-TW: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]].
+
This document will guide you through the process of installing [[Arch Linux]] using the [https://projects.archlinux.org/arch-install-scripts.git/ Arch Install Scripts]. Before installing, you are advised to skim over the [[FAQ]]. See [[Beginners' Guide]] for a highly detailed, explanatory installation guide.
  
 
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''}}.
 
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''}}.
 
See the [[Beginners' Guide]] for a more in-depth walk-through.
 
  
 
== Download ==
 
== Download ==
 
Download the new Arch Linux ISO from the [https://www.archlinux.org/download/ Arch Linux download page].
 
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.
 
* 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}}
+
* Install images are signed and it is highly recommend 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 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}}.
+
* 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 ==
 
== Installation ==
Line 34: Line 32:
  
 
=== Partition disks ===
 
=== Partition disks ===
See [[partitioning]] for details.
+
See [[partitioning]] for details.  
  
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
+
If you want to create any stacked block devices like [[LVM]], [[dm-crypt with LUKS|LUKS]], 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.
 
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]].
+
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]].
  
 
=== Mount the partitions ===
 
=== Mount the partitions ===
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}}.
+
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}}, ...) and mount your [[Swap|swap]] partition if you want them to be detected by {{ic|genfstab}}.
  
 
=== Connect to the internet ===
 
=== Connect to the internet ===
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]].
+
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 ====
 
==== Wireless ====
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netcfg#Configuration|Netcfg]].
+
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netctl]].
  
 
=== Install the base system ===
 
=== Install the base system ===
 
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.
 
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]].
+
Using the [https://projects.archlinux.org/arch-install-scripts.git/tree/pacstrap.in pacstrap] script we install the base system.
 
   
 
   
  # pacstrap /mnt base base-devel
+
  # pacstrap /mnt base
  
 
Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.
 
Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.
  
=== Install a bootloader ===
+
=== Configure the system ===
==== [[GRUB2|GRUB]] ====
+
* 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}}.
  
* For BIOS:
+
* Symlink {{ic|/etc/localtime}} to {{ic|/usr/share/zoneinfo/Zone/SubZone}}. Replace {{ic|Zone}} and {{ic|Subzone}} to your liking. For example:
 +
:{{bc|# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime}}
  
# arch-chroot /mnt pacman -S grub-bios
+
* Uncomment the selected locale in {{ic|/etc/locale.gen}} and generate it with {{ic|locale-gen}}.
 +
* 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}}
  
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
+
* Set a root password with {{ic|passwd}}.
 +
* Configure the network again for newly installed environment. See [[Network Configuration]] and [[Wireless Setup]].
  
# arch-chroot /mnt pacman -S grub-efi-x86_64
+
=== Install and configure a bootloader ===
 +
You can choose [[GRUB]] or [[Syslinux]].
  
* Install GRUB after chrooting (refer to the [[#Configure the system]] section).
+
==== GRUB ====
  
==== [[Syslinux|Syslinux]] ====
+
* For BIOS:
+
  # pacman -S grub-bios
  # arch-chroot /mnt pacman -S syslinux
+
  
=== Configure the system ===
+
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
Generate an [[fstab]] with the following command (if you prefer to use UUIDs or labels, add the {{ic|-U}} or {{ic|-L}} option, respectively):
+
  # pacman -S grub-efi-x86_64
  # genfstab -p /mnt >> /mnt/etc/fstab
+
Next we [[chroot]] into our newly installed system:
+
# arch-chroot /mnt
+
  
* Write your hostname to {{ic|/etc/hostname}}.
+
See [[GRUB#Installation|GRUB installation and Configuration]]
* 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
+
==== Syslinux ====
 
+
* 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
+
  # pacman -S syslinux
  
* Configure the bootloader: refer back to the appropriate article from the bootloader installation section.
+
See [[Syslinux#Configuration|Syslinux configuration]]
 
+
* Set a root password with {{ic|passwd}}.
+
  
 
=== Unmount and reboot ===
 
=== Unmount and reboot ===
Line 171: Line 168:
 
=== Display server ===
 
=== 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 implementation graphical user interfaces. See the [[Xorg]] article for details.
+
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.
 
[[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.
Line 188: Line 185:
  
 
See [[General Recommendations]] for post-installation tutorials like setting up a touchpad or font rendering.
 
See [[General Recommendations]] for post-installation tutorials like setting up a touchpad or font rendering.
 
<noinclude>{{Beginners' Guide navigation}}</noinclude>
 

Revision as of 15:38, 21 June 2013

This document will guide you through the process of installing Arch Linux using the Arch Install Scripts. Before installing, you are advised to skim over the FAQ. See Beginners' Guide for a highly detailed, explanatory installation guide.

The community-maintained Arch wiki is an excellent resource and should be consulted for issues first. The IRC channel (irc://irc.freenode.net/#archlinux), and the forums are also available if the answer cannot be found elsewhere. Also, be sure to check out the man pages for any command you are unfamiliar with; this can usually be invoked with man command.

Download

Download the new Arch Linux ISO from the 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: 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 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. It is intended for new installations only; an existing Arch Linux system can always be updated with pacman -Syu.

Installation

Keyboard layout

For many countries and keyboard types appropriate keymaps are available already, and a command like loadkeys uk might do what you want. More available keymap files can be found in /usr/share/kbd/keymaps/ (you can omit the keymap path and file extension when using loadkeys).

Partition disks

See partitioning for details.

If you want to create any stacked block devices like LVM, LUKS, or RAID, do it now.

Format the partitions

See File Systems for details.

If you are using (U)EFI you will most probably need another partition to host the UEFI System partition. Read Create an UEFI System Partition in Linux.

Mount the partitions

We now must mount the root partition on /mnt. You should also create directories for and mount any other partitions (/mnt/boot, /mnt/home, ...) and mount your swap partition if you want them to be detected by genfstab.

Connect to the internet

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: systemctl stop dhcpcd.service. For more information read configuring network.

Wireless

Run wifi-menu to set up your wireless network. For details, see Wireless Setup and Netctl.

Install the base system

Before installing, you may want to edit /etc/pacman.d/mirrorlist such that your preferred mirror is first. This copy of the mirrorlist will be installed on your new system by pacstrap as well, so it's worth getting it right.

Using the pacstrap script we install the base system.

# pacstrap /mnt base

Other packages can be installed by appending their names to the above command (space seperated), including the bootloader if you want.

Configure the system

  • Generate an fstab with the following command (if you prefer to use UUIDs or labels, add the -U or -L option, respectively):
# genfstab -p /mnt >> /mnt/etc/fstab
  • chroot into our newly installed system:
# arch-chroot /mnt
  • Write your hostname to /etc/hostname.
  • Symlink /etc/localtime to /usr/share/zoneinfo/Zone/SubZone. Replace Zone and Subzone to your liking. For example:
# ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
  • Uncomment the selected locale in /etc/locale.gen and generate it with locale-gen.
  • Set locale preferences in /etc/locale.conf.
  • Add console keymap and font preferences in /etc/vconsole.conf
  • Configure /etc/mkinitcpio.conf as needed (see mkinitcpio) and create an initial RAM disk with:
# mkinitcpio -p linux

Install and configure a bootloader

You can choose GRUB or Syslinux.

GRUB

  • For BIOS:
# pacman -S grub-bios
  • For EFI (in rare cases you will need grub-efi-i386 instead):
# pacman -S grub-efi-x86_64

See GRUB installation and Configuration

Syslinux

# pacman -S syslinux

See Syslinux configuration

Unmount and reboot

If you are still in the chroot environment type exit or press Template:Keypress in order to exit. Earlier we mounted the partitions under /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.

Post-installation

User management

Add any user accounts you require as as described in 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.

Package management

See pacman and FAQ#Package Management for answers regarding installing, updating, and managing packages.

Service management

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 systemctl command. Read systemd#Basic systemctl usage for more information.

Sound

ALSA usually works out-of-the-box. It just needs to be unmuted. Install alsa-utils (which contains alsamixer) and follow these instructions.

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.

Video driver

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.

If you don't know which video chipset is available on your machine, run:

$ lspci | grep VGA

For a complete list of open-source video drivers, search the package database:

$ pacman -Ss xf86-video | less

The 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:

Brand Type Driver Multilib Package
(for 32-bit applications on Arch x86_64)
Documentation
AMD/ATI Open source xf86-video-ati lib32-ati-dri ATI
Proprietary catalyst-dkms lib32-catalyst-utils AMD Catalyst
Intel Open source xf86-video-intel lib32-intel-dri Intel Graphics
Nvidia Open source xf86-video-nouveau lib32-nouveau-dri Nouveau
xf86-video-nv (legacy driver)
Proprietary nvidia lib32-nvidia-utils NVIDIA
nvidia-304xx 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 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 post-installation tutorials like setting up a touchpad or font rendering.