Skip to content

Instantly share code, notes, and snippets.

@davidpeach
Last active July 25, 2025 20:19
Show Gist options
  • Save davidpeach/71de7a956f913805b65911fee3050c68 to your computer and use it in GitHub Desktop.
Save davidpeach/71de7a956f913805b65911fee3050c68 to your computer and use it in GitHub Desktop.
Arch Linux Installation on EFI laptop (Thinkpad T470)
# These are the steps I take to install a fresh copy of Arch Linux on to my Lenovo Thinkpad T470
# Spec: i5; 16gb RAM; Integrated Intel 620 graphics; SSD;
# This will go from the very start up to having a base installation ready to add you chosen window manager or desktop environment.
# Make a bootable usb stick with the latest version of Arch Linux on.
# Plug to into computer and boot.
# Connecting to Internet (wifi)
iwctl device list
iwctl station wlan0 scan
iwctl station wlan0 get-networks
iwctl --passphrase <YOUR_PASSPHRASE> station wlan0 connect <YOUR_SSID>
loadkeys uk
# Partition the hard drive
cfdisk
# Delete all old partitions using to ui
# Create a new partition of 100M in size
# Create a new partition of 16G in size
# Create a new partition of the rest of the disk (leave the size as what it puts in for you)
# Select "write" and type yes and hit enter for each partition
# Making the filesystems in the partitions
mkfs.ext4 /dev/sda3
mkfs.fat -F32 /dev/sda1
mkswap /dev/sda2
# Mount a prepare new boot directories
mount /dev/sda3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mount/boot/efi
swapon /dev/sda2
# Initial pacman setup
pacman -Sy archlinux-keyring
pacstrap /mnt base linux-lts linux-firmware base-devel grub efibootmgr neovim networkmanager
genfstab /mnt > /mnt/etc/fstab
arch-chroot /mnt
# Timezone configuration
ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime
hwclock --systohc
nvim /etc/locale.gen
# uncommet the line with `eb_GB.UTF-8 UTF-8
# Save and exit
locale-gen
nvim /etc/locale.conf
# Add "LANG=eb_GB.UTF-8"
# Save and exit
nvim /etc/vconsole.conf
# ADD "KEYMAP=uk"
# Save and exit
nvim /etc/hostname
# Add your chosen hostname
# Save and exit
passwd
# Add and confirm root password
# Create non-root user
useradd -m -G wheel,audio,optical,storage,video <YOUR_NAME>
passwd <YOUR_NAME>
# Add and confirm your user password
EDITOR=nvim visudo
# Uncomment the line with "%wheel ALL=(ALL)ALL"
# Save and exit
systemctl enable NetworkManager
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -a
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment