Skip to content

Instantly share code, notes, and snippets.

@miguelmota
Last active May 27, 2025 05:08
Show Gist options
  • Save miguelmota/88348dacc5044921b796b8e50268ff42 to your computer and use it in GitHub Desktop.
Save miguelmota/88348dacc5044921b796b8e50268ff42 to your computer and use it in GitHub Desktop.
Arch linux install guide notes
# https://wiki.archlinux.org/index.php/Installation_guide
# iso downloads: https://archlinux.org/download/
# iso usb install: https://gist.github.com/miguelmota/de7a24a58a4c6a2a69ba5f917bf10b94
# wifi connection (iwd): https://wiki.archlinux.org/title/Iwd
# install git and other tools
sudo pacman -Sy git vim wget
# setup keyboard layout
loadkeys us
# (optional) remove any non-US mirrors from mirrorlist
vim /etc/pacman.d/mirrorlist
# or just run this script: https://gist.github.com/miguelmota/6ecc93da34ef2560b63eea36098ea303
# take note of HD dev name (ie sda)
lsblk
# take note if table type is gpt or not
sudo parted -l
# setup partition using cfdisk:
# see this to use fdisk: https://gist.github.com/miguelmota/fa44d631cc09357411c016a70313f18e
cfdisk
# - select parition table type based on parted command output (note: gpt will not show bootable option)
# scroll up/down in cfdisk type menu if to see all options
- 500MB EFI Sytem, type (ef), EFI (Fat-12/16/32) [sda1] primary
- primary, non-bootable, swap type (82) to be to 8gb in size (Linux Swap) [sda2] primary
- primary, bootable (rest, Linux Filesystem) [sda3] primary
- write
# set filesystem type (note: on virtualbox it'll be sda, on an actual system it might be nvme0n1)
mkfs.fat -F32 /dev/sda1 # the 1 is the first partiion we created
# mfs.fat -F32 /dev/nvme0n1p1
mkfs.ext4 /dev/sda3
# mfs.ext4 /dev/nvme0n1p3
fsck /dev/sda3
# fsck /dev/nvme0n1p3
lsblk
# setup swap
mkswap /dev/sda2
# mkswap /dev/nvme0n1p2
swapon /dev/sda2 # this also mounts it
# swapon /dev/nvme0n1p2
# mount drive
mount /dev/sda3 /mnt
# mount /dev/nvme0n1p3 /mnt
# install essential packages (will take a while)
pacstrap /mnt base linux linux-firmware sudo git wget curl unzip vi vim nano less parted which base-devel dosfstools man-db man-pages texinfo
# generate file system table file
genfstab -U -p /mnt >> /mnt/etc/fstab
# show partition UUIDs
blkid
# change root into the new system
arch-chroot /mnt
# all following commands should be in chroot
# setup datetime
timedatectl set-ntp true
timedatectl status
# set timezone
ln -sf /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
vim /etc/systemd/timesyncd.conf
# change to:
[Time]
NTP=0.arch.pool.ntp.org 1.arch.pool.ntp.org 2.arch.pool.ntp.org 3.arch.pool.ntp.org
FallbackNTP=0.pool.ntp.org 1.pool.ntp.org 0.fr.pool.ntp.org
# show time status
timedatectl show-timesync --all
# generate /etc/adjtime
hwclock --systohc --utc
vim /etc/locale.conf
# add the contents:
LANG=en_US.UTF-8
vim /etc/locale.gen
# uncomment line;
en_US.UTF-8 UTF-8
# generate locale environment variables
locale-gen
# mount efi to /mnt/boot
# note: if there is vfat error, then try `modprobe vfat` before mount.
mount /dev/sda1 /mnt/boot
# mount /dev/nvme0n1p1 /mnt/boot
# generate /boot/vmlinux-linux and /boot/initramfs-linux.img required for mkinitcpio
pacman -S linux
# creates /boot/initramfs-linux-fallback.img
mkinitcpio -p linux
vim /etc/hostname
# add the name of your pc
vim /etc/hosts
# 127.0.0.1 localhost
# ::1 localhost
# 127.0.0.1 myhostname.localdomain myhostname
# set up password for root
passwd
# pgp keyring
pacman -Sy archlinux-keyring
# install fs tools
pacman -S usbutils xfsprogs sysfsutils btrfs-progs f2fs-tools jfsutils e2fsprogs reiserfsprogs mdadm diffutils lvm2 logrotate
# install networking tools
pacman -S net-tools netctl iw iwd wireless_tools wpa_supplicant dhcpcd inetutils
# install other helpful tools
pacman -S cryptsetup dialog s-nail perl htop
# note: if perl install gives error, make sure to follow all locale setup steps
# enable dhcpcd
systemctl enable dhcpcd
# install bootloader
pacman -S grub efibootmgr dosfstools os-prober mtools linux-headers linux-lts linux-lts-headers
# with efi:
mkdir /boot/EFI
mount /dev/sda1 /boot/
# mount /dev/nvme0n1p1 /boot/
ls /boot # /boot/EFI
grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=grub_uefi --recheck
ls /boot/EFI # should show grub_uefi file
# on non efi:
# grub-install /dev/sda
grub-mkconfig –o /boot/grub/grub.cfg
exit
reboot
---
# if internet is not working after install (ethernet)
ip a
systemctl enable dhcpcd@enp0s3.service
ip link set enp0s3 up
---
# wifi
sudo pacman -S networkmanager
sudo systemctl start NetworkManager.service
# start on boot
systemctl enable NetworkManager.service
# list wifi
nmcli device wifi list
# connect
nmcli d wifi connect "<wifi-ssid>" password <password>
# connection status
nmcli general status
# note: disable dhcpd service if using NetworkManager
# alternatively, you can use iwctl
pacman -S iwd
systemctl enable iwd.service
systemctl start iwd.service
iwctl
> device list
> station _device_ scan
> station _device_ connect "_SSID_"
> station _device_ show
# if wifi is connected but there's not internet connection
sudo vim /etc/resolv.conf
nameserver 1.1.1.1
nameserver 1.0.0.1
---
# add user
sudo useradd alice
mkhomedir_helper alice
sudo passwd alice
sudo usermod -aG sudo alice
sudo su - alice
sudo whoami
# make user sudo
pacman -S sudo
visudo
# uncomment the wheel line
# %wheel ALL=(ALL) ALL
vim /etc/group
# add username to end of wheel group ie ":alice"
# install yay package manager
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
---
# mirrorlist helper: https://gist.github.com/miguelmota/6ecc93da34ef2560b63eea36098ea303
# aui installer helper: https://github.com/miguelmota/aui
# hibernation: https://gist.github.com/miguelmota/4111804789f05ac78d83c9fd623bd386
# fonts: https://gist.github.com/miguelmota/ee0adccb10b93b248d23f996c692b6a3
# audio: https://gist.github.com/miguelmota/ca2ed50a5ba894101246c2b1a09bcc9c
# yay: https://gist.github.com/miguelmota/cd12465fe82548d20d8a8cbadf04732a
# informant: https://gist.github.com/miguelmota/5aa8fa7478c94150111391803aec7215
# vim with clipboard: https://gist.github.com/miguelmota/08c7b5bedda4ba42563594af48618def
# crontab: https://gist.github.com/miguelmota/56db41c021f3a9f5cbc366645b4f4a71
# grub cli boot: https://gist.github.com/miguelmota/c1492b0a883a61eb6b319c5837d44974
# security: https://gist.github.com/miguelmota/e3a707d764f627343838a540d4848dd3
# ssh: https://gist.github.com/miguelmota/575af40ddb7f86b858a86a673cec3999
# ssh agent: https://gist.github.com/miguelmota/3d907d8d74da525f9900c226176bf355
# ssh 2fa: https://gist.github.com/miguelmota/45cf5254b870eeaf2e925b4d7fcfceb2
# github signing key (gpg keybase): https://gist.github.com/miguelmota/ad1f752cd223fe233deddd3d48932bdb
# docker: https://gist.github.com/miguelmota/d51e21f9ae28a629b253a5c1dd7a14dd
# notifications: https://gist.github.com/miguelmota/b773915dab3a1a36fc6b3e0e5a88809e
# i3: https://gist.github.com/miguelmota/cc9b68ec946d827b8f630ff8b9b59d25
# lxde: https://gist.github.com/miguelmota/0a04b7d9f490607ff90911e788092c09
# xfce: https://gist.github.com/miguelmota/e85222aa35e7edd84bcb5d4fca6b78f8
# lightdm: https://gist.github.com/miguelmota/5087fb8d92599efc4748c134846c8daf
# theme: https://gist.github.com/miguelmota/18bc36d0a2f7429e8907444b4138b6ee
# mate DE: https://gist.github.com/miguelmota/21b5df717c5a5c82f66e8a10aa215658
# gnome DE: https://gist.github.com/miguelmota/da8124c63845424ff536bbf3e09807b8
# vpn: https://gist.github.com/miguelmota/a11277a49d5a864e9bbb185e4b9c0e2b
# vnc: https://gist.github.com/miguelmota/9cd15049843ddf1ee1a52196f5c7e5ea
# plex: https://gist.github.com/miguelmota/90a4ed9a24d69685e40317fbb867c517
# browser: https://gist.github.com/miguelmota/062e0753c172a05bdb381a184ddbe4be
# touchpad: https://gist.github.com/miguelmota/c35999dbf9c15154d0aec8dace29d481
# printer: https://gist.github.com/miguelmota/4294e08a5f8ba24a5bb0c61306f0a116
# annotation tool: https://gist.github.com/miguelmota/887c1db468e45b7c236971f8c64cd7ea
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment