Arch for Dummies

Arch for Dummies



Arch Linux is a really nice distro offering flexibility and speed. Even though it’s a meme I can really recommend it to other people (it might be hard to install which is why I’m writing this blog post). I assume you successfully written your install media to a USB drive or CD and booted your PC from it.

Setting keyboard layout

You can use loadkeys de-latin1-nodeadkeys for a German keyboard layout. The default keyboard layout is American.

Connect to the Internet

Arch for Dummies

Over Ethernet

If you connected your computer to an Ethernet network before you booted the install media it should in theory be connected to your network. If not find out which interface is your Ethernet interface by using ip addr. It should produce an output like this:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether fff:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff
3: wlp3s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
    link/ether ff:ff:ff:ff:ff:ff brd ff:ff:ff:ff:ff:ff

All Ethernet interface start with the letter “e” and all wireless interfaces with the letter “w”. The “lo” interface can be ignored. In this case the ethernet interface should be enp0s25. We can now set an IP address for this network automatically which is required in order to use the internet:

dhcpcd enp0s25

You can replace the interface above with any interface you want to automatically configure. The command above should then produce an output like this:

enp0s25: IAID ff:ff:ff:ff
enp0s25: soliciting a DHCP lease
enp0s25: soliciting an IPv6 router
enp0s25: offered 192.168.2.187 from 192.168.2.1
enp0s25: probing address 192.168.2.187/24
enp0s25: leased 192.168.2.187 for 600 seconds
enp0s25: adding route to 192.168.0.0/24
enp0s25: adding route to 192.0.0.0/12 via 192.168.2.2
enp0s25: adding default route via 192.168.2.1
forked to background, child pid 1337

You are then connected to the internet. Try pinging koyu.space using ping -c4 koyu.space. It should produce an output like this:

PING koyu.space (217.182.80.236) 56(84) bytes of data.
64 bytes from 217.182.80.236 (217.182.80.236): icmp_seq=1 ttl=54 time=34.6 ms
64 bytes from 217.182.80.236 (217.182.80.236): icmp_seq=2 ttl=54 time=32.6 ms
64 bytes from 217.182.80.236 (217.182.80.236): icmp_seq=3 ttl=54 time=31.10 ms
64 bytes from 217.182.80.236 (217.182.80.236): icmp_seq=4 ttl=54 time=35.6 ms

--- koyu.space ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 6ms
rtt min/avg/max/mdev = 31.983/33.706/35.632/1.473 ms

Over WiFi

Enter wifi-menu and follow the instructions. After waiting for about 10 seconds after you’re being dropped back into a shell try pinging koyu.space using ping -c4 koyu.space.

Preparing disks

Arch for Dummies

I assume you want to install Arch Linux from scratch. I can’t provide a manual here on how to dual-boot your system with e.g. Windows, because this is harder than usual (and I only did it once and then never again). If you still want to dual-boot you can consult the Arch Wiki here. Make sure you use a BIOS installation with installed GRUB2 bootloader as described below.

You can find out which disk you want to format by using the command fdisk -l which should produce an output like this:

Disk /dev/sda: 167.7 GiB, 180045766656 bytes, 351651888 sectors
Disk model: XXXXXXXXXXXXXXXX
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: XXXXXXXXXXXXXXXX

Device       Start       End   Sectors   Size Type
/dev/sda1     2048   1050623   1048576   512M EFI System
/dev/sda2  1050624 351651854 350601231 167.2G Linux filesystem

Mostly your system hard drive (on Windows it’s the drive letter C:) is being /dev/sda. The command below will destroy all data on the disk (make sure you have a backup):

dd if=/dev/urandom of=/dev/sda bs=1M count=1

Replace /dev/sda with the disk you want to wipe the data off. Now there’s no way back except if you properly backed up your hard drive’s data.

Partitioning the hard drive

Arch for Dummies

In order to partition the hard drive you can run the program cfdisk. So in order to partition the drive /dev/sda enter cfdisk /dev/sda. Now we can create a partition table and format the drive as seen below.

Finding out which system to use

You can find it out by using the command ls /sys/firmware/efi. If the command returns an error you’re using a BIOS system and if not then you’re using an (U)EFI system.

(U)EFI (modern system)

In this example we want to create two partitions using the gpt disk format. One holds the data required for the computer to boot up and the other holds your own data that you’re working with everyday (pictures, documents, music, games, browsing history, programs, settings etc.). On the bottom you find buttons to interface with your disk. Please do not use VirtualBox with (U)EFI as I have no idea how to set it up, consult the Arch Wiki for more information on using (U)EFI to boot up a VirtualBox VM.

Arch for Dummies
For the people who never saw cfdisk: This is what it looks like

Your partition table should look like this now:

DeviceTypeSize
/dev/sda1EFI System512M
/dev/sda2Linux filesystemRest of the disk

Now we can go on and format the disks. First we format the partition for the EFI system with mkfs.vfat /dev/sda1. This creates a new FAT filesystem used for booting from EFI. The second partition is our Linux filesystem which can be created using mkfs.ext4 /dev/sda2. Now we have a complete filesystem structure we can install Arch Linux on.

BIOS (older systems)

Follow the instructions for UEFI systems, but instead use the dos disk format, only create one Linux filesystem partition for the whole disk and mark it bootable. It should look something like this

DeviceTypeSizeBootable?
/dev/sda1Linux filesystemRest of the diskYes

Then format it using mkfs.ext4 /dev/sda1.

Mounting the disk and start the installation

Arch for Dummies

You can mount the disks (replace [device], [folder] and [mountpoint] accordingly) like this

mount [device] [mountpoint]

And you can create a new folder like this:

mkdir -p [folder]

Creating new folders will also create a new mountpoint.

Mounting disks on (U)EFI systems

This table is an example. Please refer to the partition schemes above for an explanation. Mount the disks from bottom to top in the table, not the other way round as this causes serious issues.

DeviceMountpointNeeds new folder?
/dev/sda1/mnt/bootYes
/dev/sda2/mntNo

Mounting disks on BIOS systems

DeviceMountpointNeeds folder?
/dev/sda1/mntNo

Starting installation

If everything was mounted correctly which you can verify by using the command lsblk you can start the installation process. The command lsblk should return on (U)EFI systems something like this

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 167.7G  0 disk 
|-sda1   8:1    0   512M  0 part /boot
`-sda2   8:2    0 167.2G  0 part /

So now use this command and take some sips from your caffeinated drink, because this process will take a little bit longer than usual.

pacstrap /mnt base dhcpcd e2fsprogs inetutils linux linux-firmware man-db man-pages nano netctl s-nail usbutils base-devel wget bash-completion git dialog wpa_supplicant linux-headers

This command downloads all necessary packages and extracts them onto the hard drive.

The Arch Linux Wiki might tell you something different than the command above, because the developers changed the base package on October 6th 2019 which requires you to install some other packages like a kernel or system tools back onto your machine.

After the installation of these packages is finished you can write the partition information to your Arch Linux installation using genfstab -p /mnt > /mnt/etc/fstab.

Configuring the system

Arch for Dummies

Entering chroot

You can enter chroot by using the command arch-chroot /mnt if you have done everything correctly.

Changing root password

passwd

Setting hostname

echo yourhostname > /etc/hostname

Replace yourhostname with the desired hostname for your machine. Yes, you can give your computers names.

Setting up locales

Language

echo de_DE.UTF-8 UTF-8 >> /etc/locale.gen

Replace de_DE.UTF-8 with your desired language e.g. en_GB.UTF-8 for British English.

Now generate your locales with locale-gen and enter this command to apply the changes

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

Keyboard

echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf

Replace de-latin1-nodeadkeys with your desired keyboard layout.

Configuring superuser access

We use the editor nano to edit the file /etc/sudoers like this:

nano /etc/sudoers

A text editor will appear. Please follow the key combinations below.

Ctrl-W, wheel, Enter, Arrow-Down, POS1, Del, Del, Ctrl-X, Y, Enter

Configuring pacman

Edit the file /etc/pacman.conf like shown above and enter the key combinations below

Ctrl-W, Color, Enter, POS1, Del

Ctrl-W, lib], Enter, POS1, Del, Arrow-Down, POS1, Del

Ctrl-X, Y, Enter

Now after that is done enter pacman -Sy to refresh the package lists.

Configuring your user

useradd yourusername
passwd yourusername
mkdir /home/yourusername
chown -R yourusername:yourusername /home/yourusername
usermod -aG audio,video,wheel yourusername

Installing a bootloader

(U)EFI

First install efibootmgr like this:

pacman -S efibootmgr

Then write your bootloader to the ESP like this:

efibootmgr -c -d /dev/sda -p 1 -l \vmlinuz-linux -L "Arch Linux" -u "initrd=/initramfs-linux.img root=/dev/sda2"

Use the partition schemes described above as reference.

BIOS

Install GRUB2

pacman -S grub

And install it to the MBR and write some configuration files

grub-install /dev/sda

Then configure it

grub-mkconfig -o /boot/grub/grub.cfg

Now you installed GRUB2

Finishing up installation

Arch for Dummies

Now press Ctrl-D to exit the chroot and press Ctrl-Alt-Del to reboot your computer. If your screen turns black for a short amount of time unplug your USB drive or eject the CD used for installation.

Your computer should now successfully boot into Arch. Now login as root, reconnect to the network as described in the section “Connect to the Internet” and you’re ready to go. Log out with Ctrl-D. Your computer will still be connected to the internet.

Installing an AUR manager

The AUR (Arch user repository) is a huge repository for third-party software which is mostly proprietary and not available in the official repositories. In this guide I use the yay AUR manager. Log in with your user (not root) and install yay like this:

git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -sifc

Now follow the on-screen instructions to install yay.

Installing a graphical desktop

In this guide we use the GNOME desktop. If you need another desktop consult the Arch Wiki for a desktop of your choice.

sudo pacman -Sy gnome gnome-extra gnome-software-packagekit-plugin noto-fonts-emoji noto-fonts-cjk noto-fonts-extra chrome-gnome-shell xorg xorg-xinit --noconfirm --needed

This will install GNOME, utilities, pacman support in GNOME Software, Emoji fonts, fonts for Asian languages, extra fonts, browser plugin to install GNOME extensions and the Xorg graphics server.

Configuring graphical desktop

Edit the file /etc/gdm/custom.conf with nano and enter the following key combinations

Ctrl-W, Wayland, Enter, POS1, Del, Strg-X, Y, Enter

This disables Wayland and enables Xorg for better compatibility with graphics drivers from Nvidia.

Now enter sudo systemctl enable NetworkManager and sudo systemctl enable gdm and reboot your machine with Ctrl-Alt-Del.

Configuring hardware

Arch for Dummies

Usually Linux detects hardware out of the box, but devices like printers, Nvidia graphics cards, VirtualBox or Bluetooth needs extra configuration.

Printers

For using printers you need CUPS. This printing system is awesome, because it’s not a headache like on Windows. Open up a terminal and install CUPS like this

sudo pacman -S cups
sudo systemctl enable --now org.cups.cupsd

You should now be able to set up your supported printer from the settings menu. Usually HP and Canon consumer printers work the best.

Nvidia

Depending on your GPU-type you need a different package. Here is a broad overview on which package you’ll need.

PackageProduction year
nvidia2014+
nvidia-390xx2007-2013
nvidia-340xxbefore 2007

You can install it via pacman with sudo pacman -S [package name]. Replace [package name] with the package from the reference table above.

Bluetooth

If you installed GNOME like above you can easily enable Bluetooth with the command sudo systemctl enable --now bluetooth.

Fixing issues with Bluetooth headsets

Enter the following commands into a Terminal

echo Disable=Socket | sudo tee /etc/bluetooth/audio.conf
sudo su -
echo autospawn = no > /var/lib/gdm/.config/pulse/client.conf
echo daemon-binary = /bin/true >> /var/lib/gdm/.config/pulse/client.conf
exit
sudo -ugdm mkdir -p /var/lib/gdm/.config/systemd/user
sudo -ugdm ln -s /dev/null /var/lib/gdm/.config/systemd/user/pulseaudio.socket

After that reboot your computer and Bluetooth headsets should work without any problems.

VirtualBox Guest additions

Make sure you’re running the latest version of VirtualBox. Then use the following command to install the latest VirtualBox Guest additions.

sudo pacman -S virtualbox-guest-dkms

Reboot your virtual machine and you’re good to go.

Digging deeper

Arch for Dummies

Keeping your system updated

You can update your system simply by running yay in a Terminal.

Install more software

Software can be installed using yay [your search term]. Replace [your search term] with the software you’re looking for. You can use the AUR package list for more information like fixes, package information and more. Normal packages from the ABS can also be downloaded using yay. It’s always a good idea to read the comments in the AUR as they contain useful workarounds if a package is broken or out-of-date and the maintainer won’t fix it.

Closing words

Arch for Dummies

Installing Arch looks hard at first, but this guide is an insight on what you could do with it. I think most guides are just too uninformative or not written for average users.

Let me know in the comments if you have any troubles or answer to this post via the fediverse on [email protected] I am always there for helping people getting into Arch Linux and installing it “The Arch way”.

3 thoughts on “Arch for Dummies

Leave a Reply to Wistahe 📚👨🏽‍🔬🍧 Cancel reply

Your email address will not be published.