• Arch Linux Setup Guide

    Here is my guide to installing my Arch Linux setup (with options)
    Really, this is my process of installing Arch Linux. This process is equivalent to a guide, so here it is.
    Make sure you find your way over to the Arch wiki -- in case you don't know it, it's a super useful wiki which is loaded with useful GNU/Linux information (not only Arch users use it).

    Prepare live USB

    1. Download ISO.
    2. Check ISO against given checksum from ArchLinux Download.
    3. Write to USB.
      3.1 Locate ISO file (file will be referred to as ISO in command).
      3.2 Locate USB device fdisk -l (node will be referred to as DEVICE).
      3.3 dd if=ISO of=DEVICE status=progress.

    Now that it's (hopefully) written correctly, this is the part where you boot into the live USB.

    Launch a bash shell

    Check if system if UEFI compatible

    ls /sys/firmware/efi/efivars
    If this returns no errors and displays EFI variables, then your computer is UEFI compatible (keep note of this).

    Check internet connection

    ping 8.8.8.8 (you can use which ever server you want, of course)
    If this returns successful ping responses, then the internet is connected and you can continue.

    Setup NZ mirrors for Arch Repo

    1. Move 'mirrorlist' to 'mirrorlist.old'.
      mv /etc/pacman.d/mirrorlist{,.old}.
    2. Get NZ Arch Linux repo list.
      curl https://www.archlinux.org/mirrorlist/?country=NZ | tee -a /etc/pacman.d/mirrorlist
    3. Get AU Arch Linux repo list.
      curl https://www.archlinux.org/mirrorlist/?country=AU | tee -a /etc/pacman.d/mirrorlist
    4. Edit commenting out of entries.
      nano /etc/pacman.d/mirrorlist

    Partitioning

    1. Display current partitions.
      fdisk -l
      Locate the drive which you intend to install Arch Linux on.

    For SATA drives sd*
    For NVMe drives nvme*
    Whichever it is, I'll refer to it as DRIVE.

    1. Setup partitions using cfdisk.
      cfdisk /dev/DRIVE
      Notes:
      My usual layout is [ 200-500 MB Boot | 15-35 GB Root | * Home ].
    • Select GPT.
    • Create partitions.
    • Commit changes.
    1. Format partitions.
      3.1 Boot
      mkfs.fat /dev/DRIVE1
      3.2 Root
      mkfs.ext4 /dev/DRIVE2
      3.3 Home
      mkfs.ext4 /dev/DRIVE3

    Mount partitions

    1. Mount root.
      mount /dev/DRIVE2 /mnt
    2. Make boot directory in root.
      mkdir /mnt/boot
    3. Mount boot partition inside root.
      mount /dev/DRIVE1 /mnt/boot

    Install basesystem

    pacstrap /mnt base base-devel
    This will install Arch Linux to the mounted root partition.

    Now mount home parition to the Arch Linux install.
    mount /dev/DRIVE3 /mnt/home

    To finish, generate the fstab.
    genfstab -U /mnt >> /mnt/etc/fstab

    Chroot time!

    arch-chroot /mnt

    Setup general system config

    Generating correct locales

    Edit uncomment en_US.UTF-8 UTF-8 locale.
    nano /etc/locale.gen
    Generate the correct locales.
    locale-gen

    Set language to English

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

    Set hardware clock

    hwclock --systohc --utc

    Set hostname

    echo "MYHOSTNAME" > /etc/hostname

    Set localhost

    echo "127.0.0.1 MYHOSTNAME.localdomain MYHOSTNAME" >> /etc/hosts

    Set local time

    ln -sf /usr/share/zoneinfo/Pacific/Auckland /etc/localtime

    Change root password

    passwd

    Bootloader

    At this point the choice needs to be made between grub (UEFI or BIOS) and systemd-boot (UEFI only)

    option a: grub

    install grub components
    pacman -Sy grub os-prober efibootmgr

    BIOS

    grub-install --target=i386-pc /dev/sda --recheck --bootloader-id=arch

    UEFI

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

    Change grub timing (optional)

    1. Open defaults config: nano /etc/default/grub
    2. Change GRUB_TIMEOUT=5 to GRUB_TIMEOUT=1

    Generate grub config (DON'T FORGET THIS)
    grub-mkconfig -o /boot/grub/grub.cfg

    option b (UEFI only): systemd-boot

    bootctl install

    Write an entry
    cat > /boot/loader/entries/arch.conf << EOF title Archlinux linux /vmlinuz-linux initrd /initramfs-linux.img options root=$(blkid /dev/DRIVE2 -o export | grep ^PARTUUID | cut -d "=" -f2) EOF

    Exit and cleanup chroot

    exit or CTRL + D.

    Unmount partitions and reboot

    umount /mnt/{boot,home,.}
    reboot

    Inside basesystem setup

    Congratulations, you've made it this far!
    You've just installed the basesystem (with minimal config), now let's set it up for use.

    Start networking.

    dhcpcd
    This may take a couple of seconds to initialise.

    Make (a) user(s)

    1. useradd -mG wheel -s /bin/bash -d /home/USERNAME USERNAME
    2. passwd USERNAME

    Allow wheel users to run sudo commands (learn the basics of vi/vim)

    1. visudo.
    2. Find line with '%wheel ALL=(ALL) ALL'.
    3. Remove '#'.
    4. Add line Defaults pwfeedback for password entry feedback.

    Install packages.

    pacman -Sy net-tools networkmanager git bash-completion openssh

    Enable NetworkManager

    systemctl enable NetworkManager

    Setup a desktop environment

    Setup xorg

    pacman -S xorg-server xorg-apps xorg-xinit xorg-twm --needed

    Graphics driver

    Nouveau: pacman -S xf86-video-nouveau --needed
    Nvidia: pacman -S nvidia-340xx nvidia-340xx-settings nvidia-340xx-utils

    Options, here's the choice between GNOME, KDE, and XFCE.
    (Note: Of course, you can choose more than one, I just wouldn't recommend it)

    GNOME

    pacman -S gnome gnome-software gdm
    Start and enable GDM
    systemctl start gdm

    KDE

    pacman -S plasma kde-applications sddm
    Start and enable SDDM
    systemctl start sddm

    XFCE

    pacman -S xfce4 lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings
    Start and enable LightDM
    systemctl start lightdm

    Finally

    If the display manager works and you're able to login to your user enable the service inside a terminal or TTY; Otherwise, change TTYs and fix things.

    reboot!

    Post install stuff

    Make nano the default text editor: echo "export EDITOR=nano >> ~/.bash_profile"
    Install a bunch of apps: sudo pacman -Sy virt-manager qtpass pass chromium thunderbird firefox

    Edited by Caleb Woodbine
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment