Installing Arch

Published:

A little while ago, after I passed my candidacy exam, I had a small burst of confidence. Because of this, I ended up trying to install Arch Linux for the first time since 2014 (when I was in my math undergrad program). Below is the steps I had to take to get there!

Installing ArchLinux – 01 May 2020

  • For now with GNOME desktop environment
  • Assuming eth connectio
  • Wireless might be a little harder… look at install wiki
  • Important, if you get stuck in loop at boot
    • CTRL+ALT+F2 == new window with terminal/console

First

  • If in a virtual machine, make sure the virtual machine will load with UEFI
  • Disable secure boot
  • disable Launch CSM or Legacy Support
  • Enable USB Boot
  • Boot with USB Disk

Sanity Check

  • After booting check if we’re in UEFI mode
    • ls /sys/firmware/efi/efivars
    • If the command returns a list, we are good

Partition Disks

  • Check disk: fdisk -l
  • Delete /dev/sda and start fresh
    • gdisk /dev/sda
    • x – expert mode
    • z – zap the drive
    • y – yes, wipe GPT
    • y – yes, wipe MBR
  • Create partitions
    • cgdisk
    • name: /dev/sda
    • skip warning about damaged GPT
  • Create boot
    • ENTER or N
    • Default first sector
    • Partition Size – Arch recommends 300-500 MiB
      • More if we need more OS’s installed, LVM, encryption, BIOS limitations
      • I choose 1GiB to include a live CD image in /boot
      • https://help.ubuntu.com/community/Grub2/ISOBoot
    • GUID: EF00
    • name: boot
  • Create swap
    • Make sure to scroll down to the largest empty space
      • Sometimes doesn’t align the sections well
    • Enter or N
    • Default first sector
    • Partition Size – 1.5 x size of RAM
      • e.g., 16GB RAM => 24GiB
    • GUID: 8200
    • name: swap
  • Create root
    • Repeat process
    • Defaults for everything
    • name: root
  • Write: W
  • Confirm: yes
  • Quit: q

Formatting

  • Look at new partitions list
    • lsblk
  • You should be able to tell which is boot, swap, and root by the sizes
  • For me, it was sda1, sda2, sda3 for boot, swap, root, respsectively
  • Format the boot partition to be FAT32
    • mkfs.fat -F32 /dev/sda1
  • Enable swap
    • mkswap /dev/sda2
    • swapon /dev/sda2
  • Format root as ext4
    • mkfs.ext4 /dev/sda3

Internet Things

  • Figure out what device we have (ethernet, wireless, etc)
    • ip link
  • ….

Install

  • mount root partition
    • mkdir /mnt; mount /dev/sda3 /mnt
  • mount boot partition
    • mkdir /mnt/boot; mount /dev/sda1 /mnt/boot
  • install some things
    • pasctrap -i /mnt base base-devel linux linux-firmware dhcpcd vim
  • generate fstab file
    • genfstab -U /mnt » /mnt/etc/fstab

Configure

  • chroot
    • arch-chroot /mnt /bin/bash
  • locale
    • edit /etc/locale.gen
    • uncomment en_US.UTF-8 UTF-8
    • run locale-gen script
      • locale-gen
  • timezone
    • list: ls /usr/share/zoneinfo
    • ln -s /usr/share/zoneinfo/America/New_York /etc/localtime
  • set time standard to UTC
    • hwclock –systohc –utc
  • initramfs
    • mkinitcpio -p linux
  • hostname
    • echo ‘$hostname’ > /etc/hostname
    • add $hostname to end of /etc/hosts
      127.0.0.1	localhost
      ::1		localhost
      127.0.0.1	$hostname.localdomain	$hostname
      
  • set password for root
    • passwd
  • add user with username $user
    • useradd -m -g users -G wheel,storage,power,video -s /bin/bash $user
    • passwd $user
  • Add $user to sudoers
    • EDITOR=vim visudo
    • uncomment %wheel ALL=(ALL) ALL

Install grub bootloader

pacman -S grub efibootmgr
mkdir /boot/efi
mount /dev/sda1 /boot/efi
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg

Reboot and GNOME

  • Test internet with ping first
  • If off && wired:
    • ip link – get network interface, e.g., ens33
    • sytemctl start dhcpcd@interface.service
      • OR systemctl -f enable dhcpcd@interface.service
    • OR use systemd-networkd
      • systemctl start/enable systemd-networkd.service
      • systemctl start/enable systemd-resolved.service
      • vim /etc/systemd/network/20-wired.network
        • [Match] Name=ens33

          [Network] DHCP=ipv4

      • systemctl restart systemd-networkd.service
    • more info @ https://wiki.archlinux.org/index.php/Systemd-networkd#Required_services_and_setup
  • Install Gnome
    • sudo pacman -Syu
    • If any updates
      • sudo reboot
    • sudo pacman -S xorg xorg-server
    • sudo pacman -S gnome
  • Enable/start
    • systemctl enable NetworkManager
    • sudo systemctl enable gdm.service
    • sudo systemctl start gdm.service
  • If there is already a DE running
    • sudo systemctl disable gdm.service
    • sudo systemctl stop gdm.service (or just quit)

Turn on with Gnome

  • Settings
    • Make sure to select region/language to be English
  • Make shortcut for terminal
    • Settings
    • Keyboard shortcuts
    • Custom shorcuts “+”
      • terminal
      • gnome-terminal –geometry 80x40
  • pulse audio (?)
    • sudo pacman -S pulseaudio pulseaudio-alsa

IDK

  • multilib and aur? settings in /etc/pacman.conf??
  • wifi only setup??