Skip to content

Instantly share code, notes, and snippets.

@slash071
Last active March 21, 2025 14:05
Show Gist options
  • Save slash071/c5cfbf0104339cd4f70cff8e59efe0b0 to your computer and use it in GitHub Desktop.
Save slash071/c5cfbf0104339cd4f70cff8e59efe0b0 to your computer and use it in GitHub Desktop.
My personal Arch Linux installation

🌱 Pre-Installation

  1. Set the console keyboard layout

    Default is US (No need to loadkeys)

    Change console font & size:

    setfont ter-dXXb

    Fonts are stored in /usr/share/kbd/consolefonts/

 

  1. Verify the boot mode

    To verify the boot mode, check the UEFI bitness:

    cat /sys/firmware/efi/fw_platform_size

    It will return 64 for a 64-bit (x64) UEFI or 32 for a 32-bit (IA32) UEFI.

    If it returns No such file or directory, the system may be booted in BIOS (or CSM) mode.

 

  1. Connect to the internet

    Ensure network interface:

    ip link

    For wireless connection:

    iwctl

    Verify connection:

    ping archlinux.org

 

  1. Update the system clock

    timedatectl set-ntp true

    Check status:

    timedatectl status

 

  1. Partition the disks (UEFI)

    Partitioning using cfdisk:

    • 300M for boot is enough as EFI System
    • 2G for swap as Linux swap
    • Remaining space for the root as Linux filesystem

 

  1. Format the partitions

    mkfs.ext4 /dev/root_partition
    mkswap /dev/swap_partition

    Only format the ESP if you created now. In other words, if you are dual-booting, DO NOT format the EFI system partition.

    mkfs.fat -F 32 /dev/efi_system_partition

 

  1. Mount the file systems

    mount /dev/root_partition /mnt
    swapon /dev/swap_partition
    mount --mkdir /dev/efi_system_partition /mnt/boot

 

🏁 Installation

  1. Select the mirrors

    Synchronize package databases:

    pacman -Syy

     

  2. Install essential packages

    pacstrap -K /mnt base linux-lts linux-firmware linux-lts-headers intel-ucode

     

🎼 Configure the System

  1. Fstab

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

     

  2. Chroot

    arch-chroot /mnt

    Set font permanently:

    echo FONT=ter-dXXb >> /etc/vconsole.conf

    Install packages using pacman:

    gvim vi nano sudo opendoas base-devel terminus-font git wget ttf-dejavu man-db man-pages
    networkmanager traceroute net-tools openresolv bash-completion xclip texinfo
    dialog dhcpcd wpa_supplicant ifplugd wireless_tools bind
    pulseaudio pulseaudio-alsa pulseaudio-bluetooth alsa-utils
    bluez bluez-utils xdg-utils xdg-user-dirs libinput gvfs
    grub efibootmgr dosfstools mtools ntfs-3g os-prober
    

     

  3. Time zone

    ln -sf /usr/share/zoneinfo/<Region>/<City> /etc/localtime

    In my case: ln -sf /usr/share/zoneinfo/Asia/Tehran /etc/localtime

    hwclock --systohc

     

  4. Localization

    Uncomment relevant lines in /etc/locale.gen:

    en_US.UTF-8 UTF-8
    en_US ISO-XXXX-X
    fa_IR UTF-8
    

    And save the file.

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

     

  5. Network configuration

    echo <myhostname> > /etc/hostname

    Paste these lines in /etc/hosts:

    127.0.0.1    localhost
    ::1          localhost
    127.0.1.1    <myhostname>.localdomain    <myhostname>
    

     

  6. Root password

    passwd

     

  7. Add user(s)

    useradd -m -g users -G wheel <username>

    To give user the admin privileges, uncomment the line #%wheel ALL=(ALL:ALL) ALL in the sudoers:

    EDITOR=nano visudo

    Set password for the user:

    passwd <username>

     

  8. doas configuration

    Paste this line in /etc/doas.conf:

    permit :wheel
    
    

    The configuration file must end with a newline

    Change owner, group and permissions:

    chown -c root:root /etc/doas.conf
    chmod -c 0400 /etc/doas.conf

     

  9. Bootloader

    grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

    Make sure os-porber is not disabled in /etc/default/grub

    Make GRUB config file:

    grub-mkconfig -o /boot/grub/grub.cfg

 

  1. Reboot

    Regenerate kernel, exit chroot, unmount all and reboot:

    mkinitcpio -P
    exit
    umount -R /mnt
    reboot

     

🛠 POST tweaks

  • Add DNS servers

    To configure the NetworkManager to use resolvconf, paste these lines inside /etc/NetworkManager/conf.d/rc-manager.conf:

    [main]
    rc-manager=resolvconf

    Add DNS servers in /etc/resolvconf.conf like below:

    name_servers="8.8.8.8 1.1.1.1"

    Force resolvconf to update all its subscribers:

    sudo resolvconf -u

     

  • Make network reachable

    sudo systemctl enable --now NetworkManager

    For Wi-Fi, activate connection with:

    nmtui

     

  • Install Paru (AUR helper)

    cd /opt
    sudo git clone https://aur.archlinux.org/paru-bin.git
    sudo chown -R <username>:users ./paru-bin
    cd paru-bin
    makepkg -si

     

  • Disable beep sound

    To unloade the pcspkr kernel module, paste line below in /etc/modprobe.d/nobeep.conf:

    blacklist pcspkr
    

    Regenrate kernel:

    sudo mkinitcpio -P

     

  • Configure touchpad

    Paste these line in /etc/X11/xorg.conf.d/30-touchpad.conf:

    Section "InputClass"
        Identifier "Touchpad"
        Driver "libinput"
        Option "Tapping" "on"
        Option "NaturalScrolling" "true"
    EndSection
    

     

  • Prompt Only the Password for TTY Login

    For more details configurations, refer to the Arch Wiki.

     

  • Setup required directories:

    sudo mkdir /opt/{softwares,sources}
    sudo chown -R <username>:users /opt/{softwares,sources}
    sudo mkdir /mnt/windows

 

🖥️ Graphical Environment

  1. bspwm (Binary Space Partitioning)

    To customize Pacman, edit the /etc/pacman.conf file. Enable the color option by uncommenting it and set ParallelDownloads to 2 for faster package downloads.

    Install the necessary packages to set up the display server and appropriate driver:

    xorg xorg-xinit xorg-xrandr xorg-xsetroot

    Install bspwm (window manager), sxhkd (hotkey daemon), and other essential tools:

    bspwm sxhkd alacritty picom polybar nitrogen rofi dunst firefox arandr
    fish zsh lf mpd neofetch tmux zathura papers nemo htop btop gedit mpd eza
    amberol vlc persepolis psensor lm_sensors gnome-clocks zoxide duf polkit-gnome
    ttf-firacode-nerd ttf-hack-nerd ttf-intone-nerd ttf-font-awesome ttf-ubuntu-nerd noto-fonts noto-fonts-emoji
    

    Below packages are in AUR:

    google-chrome visual-studio-code-bin cloudflare-warp-bin localsend-bin xbanish
    gtkhash
    

    Copy configuration files from dotfiles to the appropriate locations:

    git clone https://github.com/slash071/dotfiles.git
    cd dotfiles
    cp -r config/* ~/.config/
    cp -r .local/ ~/
    cp -r .* ~/

    Install st and telegram.

    Make bspwm, sxhkd and polybar configs executable:

    chmod +x ~/.config/bspwm/bspwm
    chmod +x ~/.config/sxhkd/*
    chmod +x ~/.config/polybar/nova/scripts/*

 

Done!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment