You are here

4 June 2014
This step by step guide shows how to install Arch Linux from USB flash drive or cd. In my opinion the beginner tutorial from Arch wiki is too complicated for beginners. This is made simple and very practical, with some basic knowledge about partitions and Linux you should have no problems.

Create Arch USB flash drive:

Download Arch Linux latest dual iso from https://www.archlinux.org/download/.

Run this command to write the iso to your USB flash drive. Make sure /dev/sdb is your usb, this can be dangerous, you might overwrite some other disks. You can use gparted to find your usb and also delete any partitions beforehand.
Source code viewer
  1. sudo dd bs=4M if=~/Downloads/archlinux-2017.07.01-x86_64.iso of=/dev/sdb && sync
Programming Language: Bash

Install the base environment

 
Follow the official guide on how to install arch through command line.
https://wiki.archlinux.org/index.php/Beginners%27_guide#Installation
 
Or follow my short installation guide (I suggest to use both, if you are a first timer):
 
  • Start Arch from USB to install it.
  • Pick 64 bit (x86_64) or 32 bit (i686) when you have old dual iso instead of x86_64.
 
Make sure you have internet connection by running ping (optional).
 
Set up your partitions:If you have a single drive, the process is simple and straight-forward. If you have any trouble you can use testdisk utility.
Source code viewer
  1. sgdisk --zap-all /dev/sda
  2. cgdisk /dev/sda
  3.  
  4. # Single-partition setup:
  5. # Create a single partition for "/".
  6. # OR
  7. # Multi-partition setup:
  8. # 30G to /
  9. # 10G to /var
  10. # REMAINING to /home
  11. NB: When prompted with questions press enter for default settings. There will be a 1007 KB of space left in front of the partition for a boot partition.
  12.  
  13. # "Write" to apply the changes to disk.
  14. # "Quit".
Programming Language: Bash
 
Create filesystems (Don't know if needed any more):
Source code viewer
  1. # Single-partition setup:
  2. mkfs.ext4 /dev/sda1
  3.  
  4. # OR
  5.  
  6. # Multi-partition setup:
  7. mkfs.ext4 /dev/sda1
  8. mkfs.ext4 /dev/sda2
  9. mkfs.ext4 /dev/sda3
Programming Language: Bash
 
Mount:
Source code viewer
  1. # Single-partition setup:
  2. mount /dev/sda1 /mnt
  3.  
  4. # OR
  5.  
  6. # Multi-partition setup:
  7. mount /dev/sda1 /mnt
  8. mkdir /mnt/var
  9. mount /dev/sda2 /mnt/var
  10. mkdir /mnt/home
  11. mount /dev/sda3 /mnt/home
Programming Language: Bash
 
Select a mirror:
Source code viewer
  1. nano /etc/pacman.d/mirrorlist
  2. # Cut the best suiting mirror at the top of the file.
Programming Language: Bash
 
Install the base system:
Source code viewer
  1. pacstrap -i /mnt base base-devel
Programming Language: Bash
 
Generate an fstab:
Source code viewer
  1. genfstab -U -p /mnt >> /mnt/etc/fstab
Programming Language: Bash
 
Next, chroot into your newly installed system:
Source code viewer
  1. arch-chroot /mnt /bin/bash
Programming Language: Bash
 
Create an initial ramdisk environment:
Source code viewer
  1. mkinitcpio -p linux
Programming Language: Bash
 
Set the root password with:
Source code viewer
  1. passwd
Programming Language: Bash
 
Install the bootloader:
Source code viewer
  1. pacman -S gptfdisk syslinux
  2. syslinux-install_update -iam
Programming Language: Bash
 
Point to root partition:
Source code viewer
  1. # nano /boot/syslinux/syslinux.cfg
  2.  
  3. #Change :
  4. ...
  5. LABEL arch
  6. ...
  7. APPEND root=/dev/sda3 rw
  8. ...
  9. #To:
  10. ...
  11. LABEL arch
  12. ...
  13. APPEND root=/dev/sda1 rw
  14. ...
Programming Language: Text
 
GRUB:
Source code viewer
  1. pacman -S grub
  2.  
  3. cgdisk /dev/sda
  4. # Now we create the boot partition for grub. Select the free space (1007 KB) in top.
  5. # Use "ef02" as the file system type code GUID.
  6. # "Write".
  7. # "Quit".
  8.  
  9. grub-install --target=i386-pc --recheck /dev/sda
  10. grub-mkconfig -o /boot/grub/grub.cfg
Programming Language: Bash
 
Unmount the partitions and reboot:
Source code viewer
  1. exit
  2. reboot
Programming Language: Bash

Enable internet (Recommended):

Source code viewer
  1. ip link
  2. ip link set up dev enp2s0
  3. systemctl enable dhcpcd
  4. systemctl start dhcpcd
Programming Language: Bash
 

Choose your drivers (Recommended):

Source code viewer
  1. # https://wiki.archlinux.org/index.php/Xorg#Driver_installation
  2.  
  3. # Nvidia - first search and then install the corresponding one
  4. pacman -Ss nvidia
  5. pacman -S nvidia
  6.  
  7. # Intel
  8. pacman -S xf86-video-intel
  9.  
  10. # Radeon
  11. pacman -S xf86-video-ati
Programming Language: Bash
 
Create user (Recommended):
Source code viewer
  1. useradd -m -g users -G wheel -s /bin/bash USERNAME
  2. passwd USERNAME
  3.  
  4. # If you wish to use sudo command:
  5. visudo
  6. # Uncomment "%wheel ALL=(ALL) ALL", if you wish to be added to sudoers since you have been added to group wheel.
Programming Language: Bash
 

Locale (Recommended):

Source code viewer
  1. nano /etc/locale.gen
  2. # Uncomment: en_US.UTF-8 UTF-8
  3.  
  4. locale-gen
  5.  
  6. echo LANG=en_US.UTF-8 > /etc/locale.conf
Programming Language: Bash
 

Set repositories (Recommended):

Final step would be to install yaourt and use it instead of pacman. It includes pacman + user repositories. You will be amazed what you can get from Arch User Repositories (AUR). Also enable multilib so you can download programs like skype or wine that require 32bit packages if you are using 64bit version.
Source code viewer
  1. # 1. Open repositories configuration.
  2. nano /etc/pacman.conf
  3.  
  4. # 2. Uncomment both two lines of the [multilib] section.
  5.  
  6. # 3. Add these lines to pacman.conf so you can get yaourt from repository.
  7. [archlinuxfr]
  8. SigLevel = Never
  9. Server = http://repo.archlinux.fr/$arch
  10.  
  11. # 4. Refresh repositories.
  12. pacman -Syu
  13.  
  14. # 5. Install yaourt and package-query.
  15. pacman -S yaourt
Programming Language: Bash

Pick your favourite desktop environment: (Optional):