Skip to content

Instantly share code, notes, and snippets.

@c02y
Last active January 9, 2021 18:53
Show Gist options
  • Save c02y/503b3ecce581947db4d9f6768ff618e3 to your computer and use it in GitHub Desktop.
Save c02y/503b3ecce581947db4d9f6768ff618e3 to your computer and use it in GitHub Desktop.
Arch Linux Installation Guide

Sources:

  1. Burn the ISO into USB drive if installing it into drive directly
  • dd if=archlinux.iso of=/dev/sda bs=4M status=progress && sync
  1. Install libvirt ovmf packages and reboot if installing it into KVM NOTE: ovmf package and reboot step ensure that boot from UEFI instead of BIOS, otherwise, it would fail during the process when you try to grub-install (install bootloader)
  • choose Fireware of "UEFI x86_84: ... OVMF_CODE.fd" from Overview in VM details of KVM

  • Video XML: choose Virtio

    If using other Virtual Machines sush as VirtualBox, please ensure EFI option is enabled

  1. Boot from USB drive or ISO in KVM
  2. If no auto internet connection such as when trying to install it into drive directly, to get WIFI connected
  • iwctl
  • device list to get wifi device such as wlan0
  • station wlan0 scan
  • station wlan0 get-networks
  • station wlan0 connect WIFI_NAME and input your password
  • exit
  • ip a to ensure internet is on
  1. pacman-mirror
  • vim /etc/pacman.d/mirrorlist to get the right mirrors to the top the file
  • pacman -Syy to update the packages cache
  1. create partion
  • lsblk to get the partion list
  • gdisk /dev/sda to do action on /dev/sda device which is the hard drive to install Arch Linux into
  • o if trying to erase all partion and create a new GPT partion
  • n -> enter -> enter -> +500M ->EF00 -- EF00 is EFI partion for /boot/efi
  • n -> enter -> enter -> enter -> enter -- for / partion to use the rest of the disk space
  • w to save and exit to exit the gdisk
  1. create filesystems and mount them
  • lsblk to get the partion list
  • mkfs -t fat -F 32 /dev/sda1 -- sda1 is the EFI partion
  • mkfs -t ext4 /dev/sda2 -- sd2 is the / partion
  • mount /dev/sda2 /mnt -- mount / first
  • mkdir -p /mnt/boot/efi && mount /dev/sda1 /mnt/boot/efi && lsblk -- mount EFI
  1. install base and linux kernel and other packages
  • pacstrap /mnt base base-devel linux linux-headers linux-firmware linux-lts linux-lts-headers vim
  1. save filesystems into config file
  • genfstab -U /mnt >> /mnt/etc/fstab
  1. switch into the new system
  • arch-chroot /mnt
  1. install pacakges such as grub and install boot loader
  • pacman -S --needed grub efibootmgr efivar networkmanager intel-ucode wpa_supplicant wireless_tools dialog dosfstools os-prober mtools
  • grub-install /dev/sda -- NOTE sda
  • grub-mkconfig -o /boot/grub/grub.cfg
  1. username and password
  • passwd -- set password for root user
  • useradd -m -g users -G wheel your-name
  • passwd your-name
  • EDITOR=vim visudo -- uncomment the "%wheel ALL=(ALL) ALL" line to make your-name use sudo command
  1. swapfile
  • fallocate -l 4G /swapfile
  • chmod 600 /swapfile
  • mkswap /swapfile
  • vim /etc/fstab and append line of "/swapfile none swap sw 0 0"
  1. Last steps before finish
  • systemctl enable NetworkManager
  • vim /etc/locale.gen -- uncomment "en_US.UTF-8" line
  • locale-gen
  • exit
  • umount -a
  • reboot
  1. login into the new system, and install KDE Plasma
  • login, username: root, password: just set previouly
  • nmtui to access to wifi
  • pacman -S --needed xorg xf86-video-intel libgl mesa nvidia nvidia-utils
    • if both intel+nvidia GPUs are enabled and some problems such as external monitor occur, need to disable intel GPU in BIOS, and do not install "xf86-video-intel" package
  • pacman -S --needed lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings && systemctl enable sddm
    • pacman -S --needed plasma kde-applications -- KDE Plasma
    • pacman -S --needed xfce4 xfce4-goodies -- XFCE
  • reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment