Difference between revisions of "Installation guide"

From ArchWiki
Jump to: navigation, search
(Minimal knowledge requirements for a new user: this section is useless.)
(GRUB)
(40 intermediate revisions by 5 users not shown)
Line 1: Line 1:
 +
[[Category:About Arch]]
 
[[Category:Getting and installing Arch]]
 
[[Category:Getting and installing Arch]]
 +
[[cs:Installation Guide]]
 
[[de:Arch Install Scripts]]
 
[[de:Arch Install Scripts]]
 +
[[el:Installation Guide]]
 +
[[es:Installation Guide]]
 
[[fr:Arch_install_scripts]]
 
[[fr:Arch_install_scripts]]
 
[[it:Installation Guide]]
 
[[it:Installation Guide]]
 +
[[ko:Installation Guide]]
 +
[[pl:Installation Guide]]
 +
[[pt:Installation Guide]]
 +
[[ro:Ghid de instalare]]
 
[[ru:Installation Guide]]
 
[[ru:Installation Guide]]
 +
[[uk:Installation Guide]]
 
[[zh-CN:Installation Guide]]
 
[[zh-CN:Installation Guide]]
 
[[zh-TW:Installation Guide]]
 
[[zh-TW:Installation Guide]]
In [http://www.archlinux.org/news/install-media-20120715-released/ Install media 2012.07.15], 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 means a menu driven installer is no longer available. This article summarizes a basic install process using these scripts.
+
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]].
 +
 
 +
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''}}.
  
 
== 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].
* 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.
+
* 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. 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}}.
 
* 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}}.
Line 17: Line 28:
  
 
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).
 
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).
 
To make these changes permanent, edit {{ic|/etc/vconsole.conf}}.
 
  
 
== Partition disks ==
 
== Partition disks ==
Line 25: Line 34:
 
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
 
Remember to create any stacked block devices like [[lvm|LVM]], [[Dm-crypt_with_LUKS|LUKS]], or [[RAID|RAID]].
  
== Format partitions ==
+
== Format the partitions ==
See [[Format_a_device#Step_2:_create_the_new_file_system|here]] 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|this article]].
+
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]].
  
 
== Mount the partitions ==
 
== Mount the partitions ==
Line 34: Line 43:
  
 
== Connect to the internet ==
 
== Connect to the internet ==
Assuming a wired connection, running {{ic|dhclient}} is sufficient to get a lease. For more info visit [[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 [[Netcfg#Configuration|Netcfg]], you should stop this service first: {{ic|systemctl stop dhcpcd.service}}. For more information read [[configuring network]].
For Eg. you can try {{ic|ip link set eth0 up}} and {{ic|dhclient eth0}}.
+
  
 
=== Wireless ===
 
=== Wireless ===
If on a wireless connection, see [[Wireless Setup]] to determine if you need to load extra firmware for your device. Assuming your device is correctly loaded and working, you will need to establish a connection to your router. This can be done using {{ic|wifi-menu}} or manually as outlined below.
+
Run {{ic|wifi-menu}} to set up your wireless network. For details, see [[Wireless Setup]] and [[Netcfg#Configuration|Netcfg]].
 
+
If you have a WPA protected router, run
+
{{bc|wpa_passphrase "Your Router SSID" "Your WPA Key" > /etc/wpa_supplicant.conf}}
+
Then
+
{{bc|wpa_supplicant -Dwext -iwlan0 -c/etc/wpa_supplicant.conf}}
+
Either run this command with {{ic|& >/dev/null}}, switch to another tty and run {{ic|dhcpcd wlan0}}, or simply use the {{ic|-B}} switch to daemonize wpa-supplicant.
+
  
 
== Install the base system ==
 
== Install the base system ==
Line 60: Line 62:
 
* For BIOS:
 
* For BIOS:
  
  # pacstrap /mnt grub-bios
+
  # arch-chroot /mnt pacman -S grub-bios
  
 
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
 
* For EFI (in rare cases you will need {{ic|grub-efi-i386}} instead):
  
  # pacstrap /mnt grub-efi-x86_64
+
  # arch-chroot /mnt pacman -S grub-efi-x86_64
  
* Install GRUB after chrooting (refer to [[#Configure system|Configure system]] section).
+
* Install GRUB after chrooting (refer to the [[#Configure the system]] section).
  
 
=== [[Syslinux|Syslinux]] ===
 
=== [[Syslinux|Syslinux]] ===
 
   
 
   
  # pacstrap /mnt syslinux
+
  # arch-chroot /mnt pacman -S syslinux
  
== Configure 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):
 
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
Line 83: Line 85:
 
  # ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
 
  # ln -s /usr/share/zoneinfo/Europe/Athens /etc/localtime
  
* Set [https://wiki.archlinux.org/index.php/Locale#Setting_system-wide_locale locale] preferences in {{ic|/etc/locale.conf}}.
+
* 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}}.
 
* 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:
 
* Configure {{ic|/etc/mkinitcpio.conf}} as needed (see [[mkinitcpio]]) and create an initial RAM disk with:
Line 89: Line 92:
 
  # mkinitcpio -p linux
 
  # mkinitcpio -p linux
  
* Configure the bootloader.
+
* Configure the bootloader: refer back to the appropriate article from the bootloader installation section.
  
* For Syslinux, edit the {{ic|/boot/syslinux/syslinux.cfg}} to point to the right {{ic|/}} (root) partition. Then type the following command to install ({{ic|-i}}), set boot flag ({{ic|-a}}) and install the MBR ({{ic|-m}}):
+
* Set a root password with {{ic|passwd}}.
  
  # syslinux-install_update -iam
+
== Unmount and reboot ==
 +
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,}
  
* For GRUB, refer to the [[GRUB]] article.
+
Now reboot and then login into the new system with the root account.
* Install GRUB to the hard drive containing your boot partition:
+
  
# grub-install /dev/sda
+
== Configure pacman ==
 +
Edit {{ic|/etc/pacman.conf}} and configure pacman's options, also enabling the repositories you need.
  
* Create the {{ic|grub.cfg}}:
+
See [[Pacman]] and [[Official Repositories]] for details.
  
  # grub-mkconfig -o /boot/grub/grub.cfg
+
== Update the system ==
 +
At this point you should update your system.
  
* Set a root password with {{ic|passwd}}.
+
See [[Pacman#Upgrading packages|Upgrading packages]] for instructions.
  
== Unmount leftovers ==
+
== Add a user ==
If you are still in the chroot environment type {{ic|exit}} or press {{keypress|Ctrl+D}} in order to exit.
+
Finally, add a normal user as described in [[Users and Groups#User management|User management]].
Earlier we mounted the partitions under {{ic|/mnt}}. In this step we will unmount them:
+
# umount /mnt/{boot,home,}
+
  
Finally reboot and configure your system as explained in [[Beginners' Guide/Post-Installation]].
+
Your new Arch Linux base system is now a functional GNU/Linux environment: you can proceed to [[Beginners' Guide/Extra]] for customization suggestions.

Revision as of 04:48, 24 December 2012

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.

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. On Arch Linux, this can be done by 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 using a utility like dd. It is intended for new installations only; an existing Arch Linux system can always be updated with pacman -Syu.

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.

Remember to create any stacked block devices like LVM, LUKS, or RAID.

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, ...) 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 Netcfg, 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 Netcfg.

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. The base-devel package group should also be installed if you plan on compiling software from the AUR or using ABS.

# 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.

Install a bootloader

GRUB

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

Syslinux

# arch-chroot /mnt pacman -S syslinux

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

Next we 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
  • Set locale preferences in /etc/locale.conf.
  • Add console keymap and font preferences in /etc/vconsole.conf
  • Uncomment the selected locale in /etc/locale.gen and generate it with locale-gen.
  • Configure /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.
  • Set a root password with passwd.

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.

Configure pacman

Edit /etc/pacman.conf and configure pacman's options, also enabling the repositories you need.

See Pacman and Official Repositories for details.

Update the system

At this point you should update your system.

See Upgrading packages for instructions.

Add a user

Finally, add a normal user as described in 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.