Arch Linux installation notes

by Perroboc

12 min read

I've learned a LOT by using Arch, and I've written here some tips to remember whenever I need to reinstall it.

They might should be on the official Arch Wiki, though.

Updates

  • I've switched from firewalld to ufw
  • I've stopped using fancy terminals, and I'm sticking to Konsole
  • I'm testing if .XCompose is still required: it is
  • I want to check if Arch Installer replaces this whole guide: it might, once I get all the required packages to install along with it
  • r8125-dkms is no longer needed in my setup

Installation

I've used the following to know what to do:

Custom mirrorlist

When in step 2.1 Select the mirrors, I use reflector to setup a fast /etc/pacman.d/mirrorlist:

# reflector --save /etc/pacman.d/mirrorlist --sort rate --threads 10 --age 1 --delay 0.25 --country 'Chile,*' --fastest 10  --protocol https --latest 100

I also enable the reflector service and timer to keep the mirrorlist updated:

$ cat /etc/xdg/reflector/reflector.conf
--save /etc/pacman.d/mirrorlist
--sort rate
--age 1
--delay 0.25
--country 'Chile,*'
--fastest 10
--protocol https
--latest 100
$ sudo systemctl enable --now reflector.service
Created symlink /etc/systemd/system/multi-user.target.wants/reflector.service → /usr/lib/systemd/system/reflector.service.
$ sudo systemctl enable --now reflector.timer
Created symlink /etc/systemd/system/timers.target.wants/reflector.timer → /usr/lib/systemd/system/reflector.timer.

Custom pacstrap

These are the pacstrap arguments I like to use when in step 2.2 Install essential packages of the installation guide

# pacstrap /mnt base base-devel linux linux-firmware sudo nano networkmanager git

Create a non-root user

After step 3.7 Root password, I create a non-root user in the wheel group:

# useradd -m -G wheel USERNAME
## passwd USERNAME

Give sudo access to the wheel group:

# sed -i '/^#[[:space:]]*%wheel ALL=(ALL) ALL$/s/^#[[:space:]]*//' /etc/sudoers

Configure boot loader systemd-boot

When in step 3.8 Boot loader, I choose to use systemd-boot

After mounting EFI partition /boot, install systemd-boot boot loader:

# bootctl install

It's recommended to install microcode for your CPU:

# pacman -S amd-ucode

Configure the boot loader

# cat /boot/loader/loader.conf 
default arch.conf
console-mode max
editor no

Get the UUID of the root disk:

# blkid /dev/nvme0n1p2 --output value --match-tag PARTUUID
f0216fa0-59ee-1a47-a6b3-adace0b2ccff

Set the arch.conf entry to boot from that disk:

# cat /boot/loader/entries/arch.conf 
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options root=PARTUUID=f0216fa0-59ee-1a47-a6b3-adace0b2ccff rw quiet loglevel=3 splash

The splash kernel option will be useless unless you setup Splash screen on boot.

Then manually update systemd-boot:

# bootctl update

Package Management

Same as in Windows and MacOS, you can install software from several sources in Arch Linux.

Windows MacOS Arch Linux
System updates Windows Update MacOS Arch packages
System software Windows Features MacOS Arch packages
App Store (sandboxed) Microsoft App Store MacOS App Store flatpak, appimage, snap
Community winget brew AUR

Even though I prefer official packages provided by Arch (installable with pacman), there are some missing entries not support by Arch. Luckily, the community creates scripts to create these missing packages, and they're stored in AUR (Arch User Repository).

These AUR scripts are installed by cloning the git repository, building the package locally, and installing it afterwards. If you want to update them, you must pull git changes and rebuild and reinstall. This is really tiresome, so the community, again, comes to the rescue!

Terminal: Use yay

I like to use yay to install packages from AUR and the official repo, as it eases the installation of packages and mixes them both under an easy to use command.

Installing yay requires you to build it as Arch dictates (but only once! It can update itself 🙂):

git clone https://aur.archlinux.org/yay.git
$ cd yay
$ makepkg --syncdeps --install
$ cd ..
$ rm -rf yay
$ yay --version
yay v12.0.4 - libalpm v13.0.2

Now, instead of cloning and executing makepkg --syncdeps --install for every AUR definition and its dependencies, you can execute yay -S to install AUR definitions.

To further config yay so it doesn't ask for the usual prompts:

yay --save --answerdiff None --answerclean All --removemake

Desktop: Use octopi

When in a desktop environment like KDE, I use octopi, which gives you a nice user interface to search, update, remove, and install packages (both from AUR and official Arch repositories).

  • octopi is an application that uses both pacman and a helper like yay to manage packages.
  • octopi-notifier-qt5 is a KDE system tray application that let's you know when there are updates to be installed, so you don't forget to update your packages!
yay -S octopi octopi-notifier-qt5

resolved

Arch Linux Wiki Link

I was not able to access other local machines in my network by default, as .local resolution is not enabled.

Enable hostname resolution

sudo systemctl enable systemd-resolved.service
$ sudo systemctl start systemd-resolved.service

Access .local hostname servers

Uncomment MulticastDNS and be sure to set it to yes.

grep "MulticastDNS" /etc/systemd/resolved.conf
MulticastDNS=yes

Enable KDE Wireless Hotspot

yay -S dnsmasq

Setup KDE

When first running Arch, you only get a console. This is what I did to get a working KDE environment with AMD GPU acceleration.

AMD GPU Acceleration

Depending on the GPU you use, you should select a driver that supports it. In my case, I went with AMDGPU

yay -S vulkan-radeon libva-mesa-driver mesa-vdpau

Default KDE installation (with Wayland)

I select KDE as it has a LOT of things I consider should come by default with a desktop environment. Yes, I've tried Gnome and XFCE for years, and I regret not giving KDE a go back then.

Note: Be sure to select phonon-qt5-vlc for phonon and Noto Sans for the font.

yay -S plasma-desktop kde-system-meta konsole plasma-wayland-session xorg-xwayland firefox xdg-desktop-portal-kde sddm firewalld
$ sudo systemctl enable sddm
$ sudo reboot

Why these packages:

  • plasma-desktop is the vanilla KDE environment
  • kde-system-meta provides desktop basics like an file system explorer
  • konsole alone is a nice default terminal application. I use alacritty, but it's nice to have a default alternative.
  • plasma-wayland-session enables Wayland, which should be de defacto protocol, replacing xorg
  • xorg-xwayland is a requirement for applications not yet ported to wayland, such a wine.
  • firefox is a great web browser
  • xdg-desktop-portal-kde allows firefox to talk with the desktop environment.
  • sddm is the default login screen for KDE
  • firewalld give you basic firewall support. Although this installs the package, it doesn't enable it by default! Make sure to do so through the KDE system settings window.

Enable basic software

These are some software options I find are needed and not enabled by default for Arch.

Audio (pipewire)

Arch Linux Wiki Link

yay -S pipewire lib32-pipewire wireplumber pipewire-alsa pipewire-audio pipewire-jack pipewire-pulse pipewire-v4l2 pipewire-zeroconf gst-plugin-pipewire pipewire-roc pipewire-x11-bell
$ sudo systemctl enable pipewire pipewire-pulse wireplumber
$ sudo reboot

Check if pipewire is being used

pactl info | grep "Server Name"
Server Name: PulseAudio (on PipeWire 0.3.71)

Bluetooth (bluez)

yay -S bluez bluez-utils

App store (Discover, Flatpak, and Flathub)

I think that enabling discover to use flathub to install flatpak packages is a must nowadays:

  • discover is the default KDE app store, and allows you to browse for available software. I recommend using it only for flatpak, though.
  • flatpak is a package format to install software in linux without minding about the required distribution and compatibility.
  • flathub is the defacto flatpak repository use by almost everyone.
Flatpak
yay -S flatpak flatpak-kcm xdg-desktop-portal-gtk
$ sudo reboot
  • flatpak enables Arch to install those packages
  • flatpak-kcm allows you to configure flatpak permissions from the KDE, so something like flatseal is not needed
  • xdg-desktop-portal-gtk gives flatpak gtk applications access to some needed features, such as anti-aliased fonts.
Flathub

The default "store" for flatpak packages is flathub.org. You can add it to KDE Discover with this command:

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Use flatpak remote-list to check if it's enabled.

$ flatpak remote-list
Name    Options
flathub system
Discover

Discover is the default KDE store application to install from flatpak. Depending on your system, it might nag you about firmware updates. These commands fix that:

sudo fwupdmgr get-updates
sudo fwupdmgr update

KDE Customization

Useful packages

There are some useful packages I like to have in KDE that have simplified life for me.

  • breeze-gtk gives gtk applications the same look and feel in KDE with it's default theme.
  • kde-gtk-config gives you a nice config screen in system settings.
  • ark is a nice de/compressor application. Remember to install p7zip and unrar to enable support for 7z and rar files.
  • ttf-liberation gives your system support to see Microsoft fonts.
  • noto-fonts is a great system font, and my default for KDE.

Emoji

Emoji support for KDE doesn't come out of the box, and there's an active (stale) issue for that. Until that's solved, here's what I do (based on a recommendation in that same issue):

yay -S noto-fonts-emoji
$ mkdir ~/.fonts.conf
$ wget https://gist.githubusercontent.com/charveey/091b11ea554436d15c7fffcf01129a8a/raw/f135685cd8b5128ead7b9122613ac7bcb3f803c1/75-noto-color-emoji.conf --output-document=~/.fonts.conf/75-noto-color-emoji.conf
$ wget https://gist.githubusercontent.com/charveey/091b11ea554436d15c7fffcf01129a8a/raw/f135685cd8b5128ead7b9122613ac7bcb3f803c1/local.conf --output-document=~/.fonts.conf/local.conf
### reboot

File previews

Arch Linux Wiki Link

I personally use the following:

  • ffmpegthumbs
  • kdegraphics-thumbnailers
  • kio-admin
  • kimageformats

Spellchecking

yay -S hunspell-es_cl hunspell-en_us

Dark theme for GTK Flatpak Apps

By default, GTK3 flatpak apps in KDE run in light UI mode. Since I use Breeze-Dark, I set all GTK3 apps to use this theme:

flatpak override --system --filesystem=/usr/share/themes/
flatpak override --system --env=GTK_THEME=Breeze-Dark

For GTK4 apps, this package is enough:

yay -S gnome-themes-extra

Disable hibernate and suspend

I work with a Desktop computer that I keep always on, so I don't use these.

Arch Linux Wiki Link

sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

Use mask to disable, unmask to enable, and status to check the status of the services.

Splash screen on boot

yay -S plymouth

You can set up plymouth through KDE System Settings with plymouth-kcm:

yay -S plymouth-kcm

Hide useless menu items

Even though I install vanilla KDE, it comes with some required Dependencies I find to be not very useful, so I just hide them from the Home menu with a bash script:

apps_to_hide=(\
"avahi-discover.desktop" \
"bssh.desktop" \
"bvnc.desktop" \
"assistant.desktop" \
"designer.desktop" \
"linguist.desktop" \
"qdbusviewer.desktop" \
"geoclue-demo-agent.desktop" \
"geoclue-where-am-i.desktop" \
"google-maps-geo-handler.desktop" \
"lstopo.desktop" \
"qv4l2.desktop" \
"qvidcap.desktop" \
"qwant-maps-geo-handler.desktop" \
"wheelmap-geo-handler.desktop" \
"org.kde.kuserfeedback-console.desktop" \
"org.kde.kinfocenter.desktop" \
)
for str in ${apps_to_hide[@]}; do
  echo "Disabling $str"
  cp -f /usr/share/applications/$str ~/.local/share/applications
  echo "NoDisplay=true" >> ~/.local/share/applications/$str
done

Software setup

Software is quite usable out of the box, but I like to tinker with their options to set them up to my personal preferences.

Flatpak software list

These are the flatpak packages I commonly use:

  • com.discordapp.Discord
  • io.github.trigg.discover_overlay
  • com.spotify.Client
  • com.github.Matoking.protontricks
  • com.github.zocker_160.SyncThingy
  • com.heroicgameslauncher.hgl
  • com.steamgriddb.SGDBoop
  • com.steamgriddb.steam-rom-manager
  • com.vscodium.codium
  • net.davidotek.pupgui2
  • org.jdownloader.JDownloader

These flatpak packages enable other packages to work correctly. Install them using flatpak install

  • org.gtk.Gtk3theme.Breeze
  • org.gtk.Gtk3theme.Breeze-Dark

Steam

Arch Linux Wiki Link

I personally prefer steam to be installed from Arch linux repositories instead of flathub.

Follow the wiki to Enable the multilib repository, and then install steam:

yay -S steam

Firefox

Arch Linux Wiki Link

Open about:config in a new tab and update the following preferences:

  • extensions.pocket.enabled: falseto disable pocket
  • accessibility.force_disabled: 1 to fix delay when middle clicking
  • widget.use-xdg-desktop-portal.file-picker: 1 to use the native KDE file picker
  • media.hardwaremediakeys.enabled: false and install the Firefox plasma-integration addon to better integrate with plasma
  • media.webspeech.synth.enabled: false to disable speech synthesis

To enable Firefox on Wayland:

mkdir ~/.config/environment.d
$ echo "MOZ_ENABLE_WAYLAND=1" > ~/.config/environment.d/wayland_firefox.conf

Alacritty

Arch Linux Wiki Link

Add alacritty terminfo to the system

curl -sSL https://raw.githubusercontent.com/alacritty/alacritty/master/extra/alacritty.info | tic -x -

To have alacritty see colors for ls, first create a .dircolors file:

dircolors --print-database > .dircolors

Then add a TERM entry for alacritty:

...
TERM Eterm
TERM alacritty*
TERM ansi
...

fish will color ls automatically when the .dircolors file exists. For bash, you must add the following to .bashrc:

eval "$(dircolors -b ~/.dircolors)"

Remember that .bashrc is not called automatically when connecting through ssh, so if you want to call it, just use source:

source ~/.bashrc

Helix (advanced console text editor)

Arch Linux Wiki Link

yay -S helix

In Arch, the hx command is already used by the hex package, so the binary is renamed to helix. If you want to use it with the hx as in other systems, you can install the helixbinhx AUR package:

yay -S helixbinhx

nano (simple console editor)

Arch Linux Wiki Link

If you don't like vi-like (vi, vim, neovim, helix, etc.), maybe nano is a good option. It comes installed by default!

If you want to enable syntax highlighting, you can use nano-syntax-highlighting for that. Make sure your ~/.nanorc file uses this package!

yay -S nano-syntax-highlighting
$ cat ~/.nanorc
include "/usr/share/nano/*.nanorc"
include "/usr/share/nano/extra/*.nanorc"
include "/usr/share/nano-syntax-highlighting/*.nanorc"
set constantshow

Start applications silently

Application arguments for silent background start:

  • 1password
    • --silent
  • steam
    • -nochatui -nofriendsui -silent
  • discord
    • --start-minimized

Maintenance

Arch Linux Wiki Link

Upgrade system

yay

Orphan packages

List orphan packages

yay -Qtdq

For recursively removing orphans and their configuration files:

yay -Qtdq | yay -Rns -

AUR (Foreign) packages

List foreign packages

yay -Qm

Linux magic runes

For much of what Linux has moved forward to being as user friendly as possible, there are still some terminal magic commands that need to be executed for regular use.

I understand that these commands are needed because some systems don't do things the right way (according to some developers), so we're stuck with needing them.

How to remove ^[[200~ when pasting text on a terminal

echo "set enable-bracketed-paste Off" > ~/.inputrc

How to have an International English keyboard as in Windows

Be sure to set keyboard language to English (US, intl., with dead keys) in KDE. Then:

wget https://raw.githubusercontent.com/raelgc/win_us_intl/master/.XCompose --output-document=~/.XCompose

Hardware setup

Printing

Arch wiki link

Install the required software (CUPS) to handle printing in Linux.

yay -S cups-pdf
sudo systemctl enable cups.service
sudo systemctl start cups.service

If you're using a network printer, install and enable Avahi to discover the printer automatically.

sudo systemctl enable avahi-daemon.service
sudo systemctl start avahi-daemon.service

KDE has a great configuration screen in system settings.

yay -S system-config-printer print-manager

Now you can setup the printer(s) from KDE's System Settings > Hardware > Printers

Realtek Semiconductor Co., Ltd. RTL8125 2.5GbE Controller

No longer needed

AUR Package link

The default kernel module that supports my ethernet NIC (r8169) doesn't seem to have the right upload speed on LAN. Changing to the right module (r8125) seems to do the trick. The DKMS version in AUR seems to fix this.

yay -S linux-headers
yay -S r8125-dkms

Module r8169 might overtake r8125. To check this, check if it's loaded with lsmod | grep -i r8169. If so, it must be blacklisted:

sudo tee -a /etc/modprobe.d/blacklist-r8169.conf > /dev/null <<EOT
## To use r8125 driver explicitly
blacklist r8169
EOT

To apply the new blacklist to your kernel, update via

sudo mkinitcpio -P

After a reboot, make sure r8169 isn't loaded (lsmod | grep -i r8169), and r8125 is loaded (lsmod | grep -i r8125)

lsmod | grep -i r8169
$ lsmod | grep -i r8125
r8125

Sensors data

My motherboard uses a Nuvoton NCT6799D-R chip to communicate the sensors data.

To load the nct6775 module:

sudo tee -a /etc/modules-load.d/nct6775.conf > /dev/null <<EOT
## Load nct6775
nct6775
EOT
BIOS sensors comment
CPU fan2 seems OPT in included since it's the same profile?
CHA1 fan1
CHA2 fan3
CHA3 fan4
CHA4 fan5
W_PUMP+ fan6 this is me guessing, since I don't have a water cooling pump
AIO PUMP fan7 this is me guessing, since I don't have a water cooling pump

Troubleshoot WARNING: Possibly missing firmware for module: 'module_name'

Arch Linux Wiki Link

yay -S mkinitcpio-firmware