Jump to content

Installing Arch Linux

From YawgNetWiki

LiveCD

[edit]
  • Download the latest Archlinux ISO Image
  • Copy image to USB drive
   dd bs=4M if=path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync
  • Reboot and choose boot device in BIOS and boot the USB drive

Presetup

[edit]

Boot

[edit]

The following guide is for UEFI systems, see Installing Archlinux (Legacy) for MBR. If you have an existing UEFI bootloader somewhere, identify it and mount it somewhere to confirm you can find the efi/ folder. Once properly identified, make note of this partition's device name (ex. /dev/sdb1) and unmount it. If you do not have a UEFI partition and are starting fresh, ensure you partition/format ~300-500MB for one, it helps a lot in multi-boot environments.

Disk setup

[edit]

Partitions

[edit]

Swap is pretty much optional but if you want Hibernate, it's needed

  • /dev/sda1
    • /boot - 300MB - EFI Filesystem
  • /dev/sda3
    • swap - 8.8G - Linux swap
  • /dev/sda2
    • / - therest - Linux filesystem

It's also helpful to mount separate drives as your /home or /opt directories. I tend to put Steam/Lutris libraries in /opt and have a drive dedicated to my home folder and configs. Other system mounts I tend to put in /mnt or get automounted once I get to a desktop

  • use fdisk /dev/sd(diskletter)
  • Delete any old partitions (!!!EXCEPT EXISTING UEFI PARTITIONS!!!)
  • Create new partitions like the one above
    • For the above, make sda1 then sda3
  • Ensure types are set appropriately
  • Write the partition and exit
  • Repeat for any other disk being used that needs erasing

Format and Mount

[edit]
  • Format target disks (cmd /dev/sda1-3)
    • mkfs.ext4 for / and any others
    • mkswap and swapon for swap
    • mkfs.fat -F32 for NEW EFI partitions or /boot
  • Mount devices and directories
    • mount /dev/sda2 /mnt
    • mkdir -p /mnt/boot && mount /dev/sda1 /mnt/boot
  • Additional mounts can be done now with a modification of the following:
    • mkdir -p /mnt/opt && mount /dev/sdb1 /mnt/opt
  • Or Network Shares/CIFS stuff as well
    • mkdir -p /mnt/mnt/share && mount -t cifs //shareserver/ /mnt/share/

Update installer sources

[edit]

Repos

[edit]

See Official and Unofficial repos

Multilib

[edit]

Needed for gaming on Steam

   echo "[multilib]
   Include = /etc/pacman.d/mirrorlist" >> /etc/pacman.conf

Valveaur

[edit]

For Valve's maintained Arch repo and f-sync patch for the kernel

   echo "[valveaur]" >> /etc/pacman.conf
   echo "Server = http://repo.steampowered.com/arch/valveaur" >> /etc/pacman.conf

Update pacman keys

   pacman-key -r 8DC2CE3A3D245E64 --keyserver hkp://keyserver.ubuntu.com && pacman-key --lsign-key 8DC2CE3A3D245E64

Kernels

[edit]
linux-amd-znver2
[edit]
[linuxkernels]
Server = http://nhameh.ovh/$repo/$arch
SigLevel = Optional TrustAll

Install and Configure

[edit]

Installation

[edit]

To install the system, we use pacstrap <target> <packages>

   pacstrap /mnt base{,-devel} linux{,-headers,-firmware} nano ntfs-3g sudo git amd-ucode grub efibootmgr os-prober 
  • base/-devel
    • Base system and development tools
  • linux/-headers/-docs

Note: this presumes ntfs partitions being used and an AMD CPU, you might need to modify that for other systems

Additional packages

[edit]

More packages can be found at Arch Packages

Configure

[edit]

Hostname

[edit]
   echo "$yourhostname" > /mnt/etc/hostname
   echo "127.0.0.1		$yourhostname.localdomain	$yourhostname" >> /mnt/etc/hosts

Mounts/FSTAB

[edit]
   genfstab -U -p /mnt >> /mnt/etc/fstab

Locale

[edit]
   echo "en_US.UTF-8 UTF-8" > /mnt/etc/locale.gen

Post install and chroot

[edit]

Now we chroot into the new install and finish setting things up:

   arch-chroot /mnt

Chroot

[edit]

Language and Timezones

[edit]
   ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime
   locale-gen
   export LANG=en_US.UTF-8

Kernel

[edit]
   mkinitcpio -P

Users

[edit]
  • Change Root passwd
    • passwd
  • Create local user
    • useradd -m -G wheel $user && passwd $user
    • Uncomment the Wheel group line in /etc/sudoers

Services

[edit]

Enable any necessary services

   systemctl enable sddm
   systemctl enable NetworkManager
   systemctl enable bluetooth

Grub

[edit]

Replace /boot below with your efi directory folder if different

   grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=Arch
   grub-mkconfig -o /boot/grub/grub.cfg

Yay

[edit]

Sometimes we need AUR packages:

   cd /home/$user && git clone https://aur.archlinux.org/yay.git && chown -R $user yay/ && cd yay
   su $user
   makepkg -si
   cd .. && rm -rf yay/
[edit]

Nvidia Beta

[edit]
   nvidia{-beta,-beta-dkms,-utils-beta,-settings-beta} opencl-nvidia-beta lib32{-nvidia-utils-beta,-opencl-nvidia-beta}

Misc

[edit]

Mostly my firmware and overclocking things, but Downgrade is a life saver for when updates go wrong

   aic94xx-firmware wd719x-firmware downgrade zenmonitor zenpower-dkms zenstates-git cpupower-gui python-nvidia-ml-py3-git python-py3nvml

Exit chroot and Cleanup

[edit]

Leave chroot

   exit

Unmount any extra drives first then unmount /mnt

umount /mnt/boot
umount /mnt/home
umount /mnt

You can now reboot

Specific Scripts

[edit]
 curl https://yawg.wtf/arch/.$buildname/0_start.sh > 0_start.sh && chmod +x 0_start.sh