Archlinux - My Sanctum Sanctorum
This comprehensive guide covers setting up Arch Linux from scratch. I’d recommend first gaining familiarity with Linux through Ubuntu or similar distributions before attempting Arch, as it requires deeper system knowledge.
Prerequisites
- Internet connectivity
- A computer or laptop
- Several hours of spare time
- Patience. Patience. Patience.
Creating Bootable Installation Media
On Linux, identify your USB device using lsblk, then write the ISO:
dd bs=4M if={path_to_archlinux.iso} of=/dev/sd{x} status=progress oflag=syncInstallation Process
Initial Setup
- Disable Secure Boot in BIOS (keep UEFI enabled)
- Verify UEFI mode:
ls /sys/firmware/efi/efivars - Test internet:
ping -c3 google.com
Network Configuration
Ethernet: Start the DHCP service on your interface:
systemctl start dhcpcd@{interface}.serviceWiFi:
iw dev {interface} scan | lesswpa_supplicant -B -i {interface} -c <(wpa_passphrase {SSID} {passphrase})dhcpcd {interface}Disk Partitioning
Using gdisk, create:
- EFI partition: 512MB (type EF00)
- SWAP partition: 20GB (type 8200)
- Root partition: 80GB (type 8304)
- Home partition: Remainder (type 8300)
Formatting and Mounting
mkfs.fat -F32 /dev/sda1mkswap /dev/sda2 && swapon /dev/sda2mkfs.ext4 /dev/sda3mkfs.ext4 /dev/sda4mount /dev/sda3 /mntmkdir -p /mnt/boot && mount /dev/sda1 /mnt/bootmkdir -p /mnt/home && mount /dev/sda4 /mnt/homeCore Installation
pacstrap /mnt base base-develgenfstab -U /mnt >> /mnt/etc/fstabarch-chroot /mntSystem Configuration
Timezone:
ln -sf /usr/share/zoneinfo/{Region}/{City} /etc/localtimeLocale: Edit /etc/locale.gen to uncomment en_US.UTF-8 UTF-8, then:
locale-genSet /etc/locale.conf:
LANG=en_US.UTF-8LC_CTYPE=en_US.UTF-8LC_MESSAGES=en_US.UTF-8LC_ALL=en_US.UTF-8LANGUAGE="en_US.UTF-8"Hostname: Create /etc/hostname with your desired name.
Hosts file: Add to /etc/hosts:
127.0.0.1 localhost.localdomain localhost::1 localhost.localdomain localhost127.0.1.1 {hostname}.localdomain {hostname}Root password: passwd
Microcode: pacman -S intel-ucode
Bootloader (systemd-boot)
bootctl installbootctl updateEdit /boot/loader/loader.conf:
default archCreate /boot/loader/entries/arch.conf with UUID of root partition:
title Arch Linuxlinux /vmlinuz-linuxinitrd /intel-ucode.imginitrd /initramfs-linux.imgoptions root=UUID={UUID} rwFor hibernation, add SWAP UUID:
options root=UUID={root_UUID} resume=UUID={swap_UUID} rwEssential Packages
pacman -S iproute2 acpi iw wpa_supplicant dialog vim zsh git curl wget aria2 stow networkmanager xdg-user-dirsPost-Installation
After rebooting, optionally add SSH keys:
mkdir -p ~/.sshcurl -L https://github.com/{username}.keys >> ~/.ssh/authorized_keyssystemctl restart sshdActivate Zsh:
chsh -s $(which zsh)curl -L git.io/antigen > $HOME/antigen.zshexec zshPacman Configuration
Edit /etc/pacman.conf to uncomment:
ColorTotalDownloadCheckSpaceVerbosePkgListsILoveCandyUser Management
useradd -m -G wheel {username}passwd {username}visudo # Uncomment: %wheel ALL=(ALL) ALLsu - {username}xdg-user-dirs-updateDesktop Environment
Install KDE Plasma and applications:
pacman -S plasma docker firefox dolphin dolphin-plugins zip unzip unrar vlc p7zip rsync syncthing konsole openssh git blender krita gimp inkscape kwallet kwalletmanager networkmanager digikam spectacle ntfs-3g cups print-manager imagemagick mesa okular gparted screenfetch bluez bluez-utils pulseaudio-bluetooth linux-headers whoisSystem Services
systemctl enable NetworkManagersystemctl enable org.cups.cupsdsystemctl enable sddmsystemctl enable bluetoothsystemctl enable sshdAdvanced Topics
NVIDIA Driver Setup (Optimus)
pacman -S bumblebee mesa nvidia xf86-video-intelgpasswd -a {username} bumblebeesystemctl enable bumblebeedpacman -S mesa-demos nvidia-settings intel_gpu_tools cuda cudnn bbswitchCheck GPU usage: nvidia-smi
Run applications on GPU: optirun -b none {app} -c :8
Touchpad Gestures
gpasswd -a $USER inputgit clone https://aur.archlinux.org/libinput-gestures.gitcd libinput-gestures && makepkg -scilibinput-gestures-setup autostartShutdown Timeout Reduction
Create /etc/systemd/system.conf.d/timeout.conf:
[Manager]DefaultTimeoutStartSec=15sDefaultTimeoutStopSec=5sCommon Pacman Commands
- Update database:
pacman -Syy - Full system upgrade:
pacman -Syu - Install package:
pacman -S {package} - Remove package:
pacman -Rs {package} - Search database:
pacman -Ss {package}