System Configuration
Quick Reference
# Essential configuration files
/etc/hostname # System hostname
/etc/hosts # Host name resolution
/etc/locale.conf # System locale
/etc/locale.gen # Available locales
/etc/vconsole.conf # Console font and keymap
/etc/fstab # Filesystem mount table
/etc/sudoers # Sudo configuration
/etc/pacman.conf # Package manager config
Hostname
Set Hostname
# Using hostnamectl (recommended)
sudo hostnamectl set-hostname archbox
# Or directly edit file
echo "archbox" | sudo tee /etc/hostname
# Verify
hostnamectl
hostname
Configure /etc/hosts
# /etc/hosts
cat > /etc/hosts << 'EOF'
127.0.0.1 localhost
::1 localhost
127.0.1.1 archbox.localdomain archbox
EOF
Hostname Types
# Static hostname (stored in /etc/hostname)
hostnamectl set-hostname archbox
# Pretty hostname (human-readable)
hostnamectl set-hostname "Evan's Arch Workstation" --pretty
# Transient hostname (temporary, lost on reboot)
hostnamectl set-hostname tempname --transient
# View all
hostnamectl
Locale Configuration
Enable Locales
# Edit /etc/locale.gen
sudo vim /etc/locale.gen
# Uncomment needed locales
en_US.UTF-8 UTF-8
en_GB.UTF-8 UTF-8
# Generate locales
sudo locale-gen
Set System Locale
# Set default locale
sudo localectl set-locale LANG=en_US.UTF-8
# Or edit directly
echo "LANG=en_US.UTF-8" | sudo tee /etc/locale.conf
# Additional locale variables
cat > /etc/locale.conf << 'EOF'
LANG=en_US.UTF-8
LC_COLLATE=C
LC_TIME=en_GB.UTF-8
EOF
Console Configuration
Keyboard Layout
# Set console keymap
echo "KEYMAP=us" | sudo tee /etc/vconsole.conf
# Common keymaps
us # US English
uk # UK English
de-latin1 # German
fr # French
es # Spanish
# List available keymaps
localectl list-keymaps | grep us
Time and Date
Set Timezone
# Using timedatectl (recommended)
sudo timedatectl set-timezone America/New_York
# Or symlink manually
sudo ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
# List timezones
timedatectl list-timezones
timedatectl list-timezones | grep America
Hardware Clock
# Sync hardware clock to system time
sudo hwclock --systohc
# Check hardware clock
sudo hwclock --show
# Use UTC (recommended for Linux-only)
sudo timedatectl set-local-rtc 0
# Use local time (for Windows dual boot)
sudo timedatectl set-local-rtc 1
NTP Synchronization
# Enable NTP
sudo timedatectl set-ntp true
# Check status
timedatectl status
# Using systemd-timesyncd
systemctl status systemd-timesyncd
cat /etc/systemd/timesyncd.conf
User Management
Create User
# Create user with home directory
sudo useradd -m -G wheel -s /bin/bash username
# Set password
sudo passwd username
# Create with specific UID
sudo useradd -m -u 1001 -G wheel username
# Create system user (no login)
sudo useradd -r -s /usr/bin/nologin serviceuser
User Options
| Option | Description |
|---|---|
-m |
Create home directory |
-G |
Add to supplementary groups |
-s |
Set login shell |
-u |
Specify UID |
-c |
Comment/full name |
-d |
Home directory path |
-r |
System account |
-e |
Account expiry date |
Modify User
# Change shell
sudo usermod -s /bin/zsh username
# Add to group
sudo usermod -aG docker username
# Change home directory
sudo usermod -d /home/newdir -m username
# Lock account
sudo usermod -L username
# Unlock account
sudo usermod -U username
# Set expiry
sudo usermod -e 2025-12-31 username
Delete User
# Delete user (keep home)
sudo userdel username
# Delete user and home directory
sudo userdel -r username
Sudo Configuration
Enable Sudo for wheel
# Use visudo (validates syntax)
EDITOR=nvim sudo visudo
# Uncomment this line:
%wheel ALL=(ALL:ALL) ALL
# For passwordless sudo (less secure)
%wheel ALL=(ALL:ALL) NOPASSWD: ALL
fstab Configuration
Common Entries
# Root partition (ext4)
UUID=abc123... / ext4 rw,relatime 0 1
# Boot partition (EFI)
UUID=def456... /boot vfat rw,relatime,fmask=0022,dmask=0022 0 2
# Home partition
UUID=ghi789... /home ext4 rw,relatime 0 2
# Swap partition
UUID=jkl012... none swap defaults 0 0
# Swap file
/swapfile none swap defaults 0 0
Btrfs fstab
# Root subvolume
UUID=abc123... / btrfs rw,noatime,compress=zstd,subvol=@ 0 0
# Home subvolume
UUID=abc123... /home btrfs rw,noatime,compress=zstd,subvol=@home 0 0
# Var subvolume
UUID=abc123... /var btrfs rw,noatime,compress=zstd,subvol=@var 0 0
# Snapshots
UUID=abc123... /.snapshots btrfs rw,noatime,compress=zstd,subvol=@snapshots 0 0
Common Mount Options
| Option | Description |
|---|---|
defaults |
rw, suid, dev, exec, auto, nouser, async |
noatime |
Don’t update access time (performance) |
relatime |
Update atime only if older than mtime |
compress=zstd |
Btrfs compression |
discard |
TRIM for SSDs (or use fstrim.timer) |
nofail |
Don’t fail boot if mount fails |
x-systemd.automount |
Mount on first access |
uid=1000,gid=1000 |
Ownership for non-Linux filesystems |
pacman.conf
Key Settings
# /etc/pacman.conf
[options]
# Misc options
Color
VerbosePkgLists
ParallelDownloads = 5
ILoveCandy
# Security
SigLevel = Required DatabaseOptional
LocalFileSigLevel = Optional
# Ignore packages from upgrades
IgnorePkg = linux linux-headers
IgnoreGroup = gnome
[core]
Include = /etc/pacman.d/mirrorlist
[extra]
Include = /etc/pacman.d/mirrorlist
# Enable 32-bit packages
[multilib]
Include = /etc/pacman.d/mirrorlist
Environment Variables
System-Wide
# /etc/environment (simple KEY=value)
EDITOR=nvim
VISUAL=nvim
# /etc/profile.d/custom.sh (shell scripts)
export EDITOR=nvim
export PATH="$PATH:/opt/custom/bin"
User-Specific
# ~/.bash_profile or ~/.zshenv
export EDITOR=nvim
export VISUAL=nvim
export BROWSER=firefox
export TERMINAL=kitty
# XDG directories
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_DATA_HOME="$HOME/.local/share"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_STATE_HOME="$HOME/.local/state"
Default Applications
Using xdg-mime
# Query default application
xdg-mime query default text/html
xdg-mime query default application/pdf
# Set default application
xdg-mime default firefox.desktop text/html
xdg-mime default org.pwmt.zathura.desktop application/pdf
# Query file type
xdg-mime query filetype file.pdf
mimeapps.list
# ~/.config/mimeapps.list
[Default Applications]
text/html=firefox.desktop
text/plain=nvim.desktop
application/pdf=org.pwmt.zathura.desktop
image/png=imv.desktop
image/jpeg=imv.desktop
video/mp4=mpv.desktop
inode/directory=thunar.desktop
[Added Associations]
text/plain=nvim.desktop;code.desktop
Quick Reference
# Hostname
hostnamectl set-hostname NAME
# Locale
localectl set-locale LANG=en_US.UTF-8
locale-gen
# Keyboard
localectl set-keymap us
# Timezone
timedatectl set-timezone America/New_York
# NTP
timedatectl set-ntp true
# Users
useradd -m -G wheel username
passwd username
# Groups
usermod -aG groupname username
# fstab
mount -a
findmnt --verify
# Sudo
EDITOR=nvim visudo