Skip to content

Arch Linux installation guide

Last updated: May 1, 2021

The installation guide below is a summarized version of the official Installation Guide.

Installing basic system

  1. Choose correct keyboard keymaps

    loadkeys keymap
    
  2. Assert boot mode

    ls /sys/firmware/efi/efivars
    
  3. Make sure internet connection is present

    ping 8.8.8.8
    
  4. Set correct system time

    timedatectl set-ntp true
    
  5. Partition the disks

    1. List disks using fdisk

      fdisk -l
      
    2. If UEFI is present, use GPT and make EFI partition, swap, and root /

      cfdisk /dev/sdX # or /dev/nvme0nX
      
    3. Set correct size, type and write partition table.

  6. Format the disks

    1. Make EFI partition

      mkfs.fat -F32 /dev/sdXA # A is EFI partition
      
    2. Make swap

      mkswap /dev/sdXB # B is swap partition
      
    3. Turn swap on

      swapon /dev/sdXB
      
    4. Make root fs

      mkfs.ext4 /dev/sdaXC # C is root partition
      
  7. Mount root partition to mnt

    mount /dev/sdXC /mnt
    
  8. Install necessary packages

    pacstrap /mnt base base-devel linux linux-firmware vim nano man zsh
    

    Configuring system

  9. Write filesystem table

    genfstab -U /mnt >> /mnt/etc/fstab
    
  10. Change root to /mnt

    arch-chroot /mnt
    
  11. Set correct time zone

    ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime
    
    hwclock --systohc
    
  12. Set locale

    1. Uncomment the correct locale

      vim /etc/locale.gen
      
    2. Set locale

      locale-gen
      
  13. Set hostname and hosts

    1. Add your hostname yourhostname

      echo "yourhostname" >> /etc/hostname
      
    2. Append the following to /etc/hosts

      127.0.0.1   localhost
      ::1         localhost
      127.0.1.1   yourhostname.localdomain    yourhostname
      
  14. Setup root password using passwd

    passwd
    
  15. Add default users

    1. Add new user

      useradd -m -s /bin/zsh newuser
      
    2. Give new user a password with passwd

      passwd newuser
      
    3. Add new user to the wheel

      usermod -aG wheel,audio,video,optical,storage newuser
      
    4. Setup sudo

      pacman -S sudo
      
    5. Enable wheel with visudo

      visudo
      
  16. Setup grub

    1. Install grub and efi-tools

      pacman -S grub efibootmgr dosfstoosl os-prober mtools
      
    2. Make efi boot directory

      mkdir /boot/EFI
      
    3. Mount efi partition

      mount /dev/sdXA /boot/EFI
      
    4. Install grub (efi) for x86-64

      grub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck
      
    5. Make grub config file

      grub-mkconfig -o /boot/grub/grub.cfg
      
  17. Network manager for internet connectivity

    pacman -S networkmanager
    
    systectl enable NetworkManager # enable network manager
    
  18. Optional: Reboot to conclude with bare system setup.

    exit # now back to iso image
    umount -R /mnt
    shutdown now # or reboot
    

Additional setup for a complete system

  1. Install audio

    pacman -S pulseaudio pulseaudio-alsa
    
  2. Install a Graphical user interface; Display server (xorg), display driver (nvidia), desktop environment (gnome), window manager, display manager (gdm).

    1. Install packages

      pacman -S gnome nvidia # gnome-extra for further applications
      
    2. Enable display manager for next reboot

      systemctl enable gdm.service
      
  3. Additional network tools

    pacman -S openssh rsync
    
  4. Development tools: git, htop

    pacman -S git htop
    
  5. Reboot

    exit # now back to iso image
    umount -R /mnt
    shutdown now # or reboot