Skip to content

Instantly share code, notes, and snippets.

@withnix
Last active November 13, 2025 17:51
Show Gist options
  • Select an option

  • Save withnix/d0e03f483547bd41634cbd55e171551e to your computer and use it in GitHub Desktop.

Select an option

Save withnix/d0e03f483547bd41634cbd55e171551e to your computer and use it in GitHub Desktop.
Arch Installation with systemd-boot and systemd-networkd

Pre-installation

Live CD installation section

Create a bootable USB Flash Drive

Download Arch Linux ISO

You may use Rufus, balenaEtcher or Ventoy

or from linux command line:

dd if=/path/to/archlinux.iso of=/dev/sdX bs=4M status=progress oflag=sync && sync

Internet connection and system clock

Check your connection

ip link
ping -c3 archlinux.org

Partitions

fdisk /dev/nvme0n1

Get your disk name - fdisk -l

Type g to use a GPT, in new systems no reason to use MBR

n - new parition p - view the partition table t - change partition type w - save changes

Label type: GPT

Size Partition Type
1GB /dev/nvme0n1p1 1 EFI partition
remaining /dev/nvme0n1p2 2 root/home partition

Check new partitions table:

lsblk

Formating

mkfs.fat -F32 /dev/nvme0n1p1 && mkfs.ext4 /dev/nvme0n1p2

Mount new system partitions

mount /dev/nvme0n1p2 /mnt
mount --mkdir /dev/nvme0n1p1 /mnt/boot

Installation

Chroot and system installation

System installation

# Install base system packages
pacstrap /mnt linux linux-firmware base efibootmgr intel-ucode

Install amd-ucode instead of intel-ucode if you have AMD cpu

Generate fstab

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

Chroot on new system

arch-chroot /mnt /bin/bash
# Install useful packages
pacman --noconfirm -S base-devel neovim git zsh

Timezone

Set your current local timezone

ln -s /usr/share/zoneinfo/Europe/Moscow /etc/localtime

Replace region to yours

Enable NTP server sync

timedatectl set-ntp true

Locale

Uncomment selected row on /etc/locale.gen file:

en_US.UTF-8 UTF-8

Generate locale:

locale-gen

Create locale.conf file:

echo "LANG=en_US.UTF-8" >> /etc/locale.conf

Hosts

echo "myhostname" > /etc/hostname

Instead of myhostname, enter any name you like

Open the /etc/hosts and write (change myhostname to your own)

127.0.0.1   localhost
::1         localhost
127.0.1.1   myhostname.localdomain  myhostname

Generate system image

mkinitcpio -P

Root password

Set the root password:

passwd

Systemd-boot

bootctl --path=/boot install

Create /boot/loader/entries/arch.conf configuration file:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=UUID=<UUID> rw rootfstype=ext4

Replace intel-ucode to amd-ucode if you use AMD cpu

Use blkid or lsblk -f to get your <UUID>

and create /boot/loader/loader.conf configuration file:

default arch.conf
timeout 0
console-mode    max
editor  no

Systemd-boot require specific mask for partition. Add fmask=0077 and dmask=0077 to fstab:

UUID=<UUID>          /boot       vfat        rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2

Optional, create /boot/loader/entries/arch-fallback.conf for fallback image:

title	Arch Linux (fallback initramfs)
linux	/vmlinuz-linux
initrd	/intel-ucode.img
initrd	/initramfs-linux-fallback.img
options	root=UUID=<UUID> rw rootfstype=ext4

Create user

Run visudo and uncomment the line:

%wheel ALL=(ALL:ALL) ALL

Create new user and add them on wheel group

useradd -mG wheel -s /bin/zsh <NAME>

Change the new user passord:

passwd <NAME>

Network

This is necessary for the internet connection after installation

Install and run NetworkManager service

pacman -S networkmanager && systemctl enable NetworkManager

You don't need to configure systemd-networkd if you already use NetworkManager

Systemd-networkd

Manual network configuration with using pre-installed systemd service

Create /etc/systemd/network/20-wired.network file:

[Match]
Name=en*

[Network]
DHCP=yes

And enable service:

systemctl enable systemd-networkd.service

Systemd-resolved

systemctl enable systemd-resolved.service

To provide domain name resolution for software that reads /etc/resolv.conf directly, replace /etc/resolv.conf with a symbolic link to it:

ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

If you want to use your own dns-servers, specify them in /etc/systemd/resolved.conf.d/dns_servers.conf:

[Resolve]
DNS=<your DNS servers here>

Reboot

exit && unmount -a && reboot

Post-installation

Graphics, fonts, user-space packages and pacman configuration

Pacman

Config — /etc/pacman.conf

To enable multilib (32-bit) repositiries uncomment next rows:

[multilib]
Include = /etc/pacman.d/mirrorlist

Mirrors

pacman --noconfirm -S reflector && \
reflector --save /etc/pacman.d/mirrorlist -p https -l 20 --sort rate -c Germany && \
pacman -Syyu

AUR helper (yay)

git clone https://aur.archlinux.org/yay-bin.git && cd yay-bin && makepkg -si

Optional, disable DEBUG packages in /etc/makepkg.conf

OPTIONS=(strip docs !libtool !staticlibs emptydirs zipman purge !debug lto)

AMD

pacman --noconfirm -S mesa lib32-mesa vulkan-radeon lib32-vulkan-radeon libva-utils

Sound

pacman --noconfirm -S pipewire-{jack,alsa,pulse} wireplumber rtkit
systemctl enable --now --user pipewire pipewire-pulse wireplumber

Bluetooth

pacman --noconfirm -S bluez bluez-utils
systemctl enable --now bluetooth

Desktop

KDE Plasma

Ready-to-use Desktop Environment

pacman -S plasma

Enable SDDM service

systemctl enable --now sddm

Remove unnecessary packages

pacman -Rns discover oxygen

Sway

Tiling wayland compositor for build your own desktop

pacman --noconfirm -S sway

Put this in your $HOME/.zprofile (or $HOME/.bash_profile if you use bash) to start sway when you login without display manager:

if [ -z "${WAYLAND_DISPLAY}" ] && [ "${XDG_VTNR}" -eq 1 ]; then
    exec sway
fi

If you want use autologin without display manager create /etc/systemd/system/[email protected]/autologin.conf getty config file with

[Service]
ExecStart=
ExecStart=-/usr/bin/agetty --autologin with --noclear %I $TERM

Packages (Optional)

pacman --noconfirm -S zsh-completions zsh-autosuggestions foot vifm ttf-ibm-plex curl mpv ripgrep yt-dlp restic ttf-nerd-fonts-symbols-mono noto-fonts-emoji noto-fonts-cjk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment