Skip to content

Instantly share code, notes, and snippets.

@bashelled
Last active April 3, 2021 12:23
Show Gist options
  • Save bashelled/abb2a2992d98572cd408efcaff32bac7 to your computer and use it in GitHub Desktop.
Save bashelled/abb2a2992d98572cd408efcaff32bac7 to your computer and use it in GitHub Desktop.
How to install Arch Linux on UEFI systems.

Installing Arch on EFI

  • Root: /dev/sda5
  • ESP: /dev/sda2
  • Swap (optional): /dev/sda7
    Change these details to your own.
    Needed* < the asterik means you must do the step

1. Partition in cgdisk (* if you haven't done it before install)

Just repartition your drive, or delete everything

2. Make filesys*

mkfs.ext4 /dev/sda5
mkswap /dev/sda7

3. Run keyload (* if you don't use us)

If you use the uk keyboard you would use:

loadkeys uk

See the ArchWiki for more info.

4. Wifi*

At ~, make wpasu.conf:

ctrl_interface=/run/wpa_supplicant
update_config=1

Then run:

wpa_supplicant -B -i interface -c ~/wpasu.conf

After that, use wpa_cli and run:

add_network
set_network 0 ssid "WIFINAME"
set_network 0 psk "PASSWORD"
enable_network 0
save_config
quit

5. Install (* obviously)

mount /dev/sda5 /mnt
swapon /dev/sda7
pacstrap /mnt base linux linux-firmware

POST INSTALL STARTS HERE (don't restart yet!)

6. Make fstab*

genfstab -U /mnt >> /mnt/etc/fstab

7. Chroot*

arch-chroot /mnt

8. Timezone*

timedatectl set-timezone Europe/Paris

9. Locales*

locale-gen
echo LANG=en_GB.UTF-8 > /etc/locale.conf
export LANG=en_GB.UTF-8

10. Network*

pacman -S networkmanager
echo myarch > /etc/hostname
touch /etc/hosts
pacman -S nano
nano /etc/hosts

Add to nano:

127.0.0.1	localhost
::1		localhost
127.0.1.1	myarch

11. Password*

passwd

12. Install GRUB** (you must do this, or all your work will go to atoms)

pacman -S grub efibootmgr
mkdir /boot/efi
mount /dev/sda2 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Aaaand done! Now exit

exit

and reboot

shutdown -r now

after the reboot...

13. Desktop Enviroment

this is optional but you will do it anyways soooo

pacman -S xorg
pacman -S # (de/wm here) 
# For a decent DE, choose Gnome. With Gnome, you can skip the next step.
# For a decent WM, choose i3(-gaps)

14. Display Manager (* if you installed a DE or a WM)

Change GDM to any other one (LXDM, SDDM, LightDM, etc)

pacman -S gdm
systemctl start gdm.service
systemctl enable gdm.service

15. Connect to Network

Do this with your DE network manager, else use the same steps in 4. Make sure to use this in a terminal:

systemctl enable NetworkManager.service

16. Change keymaps

Do this in a DE, i have no idea how to do it in WMs, else use step 3.

17. Install neccesary stuff

pacman -S nano vim sudo curl git docker etc

18. Users

useradd username -m -r -p password
su username # changes into user account

19. Add AUR support as user account

pacman -S base-devel
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si

20. You're done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment