Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Mavili-Mordecai/0c6333b3e434f23e7925c8e17c56e290 to your computer and use it in GitHub Desktop.
Save Mavili-Mordecai/0c6333b3e434f23e7925c8e17c56e290 to your computer and use it in GitHub Desktop.
Install Arch Linux using EFI and GRUB

Note: If you are going to do dual boot with Windows, then you should first install Windows and then archlinux just without creating an EFI partition.

  1. Setup pacman-key (fixing this problem)

    • pacman-key --init
    • pacman-key --populate
    • pacman-key --refresh
  2. Ping some site on the Internet to verify connection:

    • ping archlinux.org
  3. Update system clock:

    • timedatectl set-ntp true
    • timedatectl set-timezone Zone/SubZone (America/Los_Angeles, Canada/Eastern, etc.)
    • timedatectl status
  4. Download mirrorlist:

    • curl -o /etc/pacman.d/mirrorlist https://archlinux.org/mirrorlist/all/
    • Uncomment the mirrors you need (the higher, the higher the priority of the mirror)
  5. Create EFI partition:

    • fdisk /dev/sda
      • g (to create a new partition table)
      • n (to create a new partition)
      • 1
      • enter
      • +300M
      • t
      • 1 (for EFI)
      • w
  6. Create /root partition:

    • fdisk /dev/sda
      • n
      • 2
      • enter
      • +30G
      • w
  7. Create /home partiton:

    • fdisk /dev/sda
      • n
      • 3
      • enter
      • enter
      • w
  8. Create the filesystems:

    • mkfs.fat -F32 /dev/sda1
    • mkfs.ext4 /dev/sda2
    • mkfs.ext4 /dev/sda3
  9. Mount the /root and /home directories:

    • mount /dev/sda2 /mnt
    • mount --mkdir /dev/sda3 /mnt/home
  10. Install Arch linux base packages:

    • pacstrap -i /mnt base linux linux-firmware
  11. Generate the /etc/fstab file:

    • genfstab -U -p /mnt >> /mnt/etc/fstab
  12. Chroot into installed system:

    • arch-chroot /mnt
    • timedatectl set-ntp true
  13. Set the timezone:

    • ln -sf /usr/share/zoneinfo/Europe/Moscow /etc/localtime
  14. Update the Hardware clock:

    • hwclock --systohc
  15. Install some packages:

    • pacman -S nano sudo networkmanager refind gdisk
  16. Setup hostname

    • nano /etc/hostname (write you PC name)
  17. Setup host:

    • nano /etc/hosts
    • And write this:
    • 127.0.0.1 localhost
    • ::1 localhost
    • 127.0.1.1 pcname.localdomain pcname
  18. Setup users:

    • useradd -m username
    • usermod -aG audio,video,wheel,storage username
    • passwd (Change the password for root)
    • passwd username (Change the password for username)
  19. We allow the wheel group to execute commands via sudo

    • EDITOR=nano visudo (uncomment %wheel ALL=(ALL:ALL) ALL)
  20. Enabling NetworkManager

    • systemctl enable NetworkManager
  21. Set and generate a locale:

    • nano /etc/locale.gen (uncomment en_US.UTF-8)
    • locale-gen
  22. Create swap file:

    • fallocate -l 2G /swapfile
    • chmod 600 /swapfile
    • mkswap /swapfile
    • echo '/swapfile none swap sw 0 0' | tee -a /etc/fstab
  23. Install refind

    • refind-install
  24. Edit refind.conf

    • nano /boot/efi/EFI/refind/refind.conf
    • Press Ctrl+W and find "Arch Linux", then replace this line:
    • options root=PARTUUID=someuuid rw add_edi_mcmmap
    • on this:
    • options root=PARTUUID=/dev/sda2 rw add_edi_mcmmap
  25. Edit refind-linux.conf

    • nano /boot/refind-linux.conf Delete the first two lines that mention "archiso"
  26. Exit, unount and reboot:

    • exit
    • umount /mnt -l
    • reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment