Installing archlinux 2021.12.01

Archlinux Linux

Despite following the installation guide, I encountered various issues when configuring archlinux (2021.12.01) recently.

I’m not sure if these were failures on my part, but in any case I documented my configuration steps below.

First step was to get a working internet connection.

My network interface is enp3s0 so all commands reference that:
Manually add an IP address and default route:

ip address add 192.168.1.199/24 dev enp3s0
ip route add 0.0.0.0/0 via 192.168.1.1 dev enp3s0

Add nameserver(s) to /etc/resolv.conf (insert your own nameserver addresses – if you have only one just add the one)

echo "nameserver 192.168.1.1" >> /etc/resolv.conf
echo "nameserver 192.168.1.2" >> /etc/resolv.conf

Install netctl & ifplugd

pacman -S netctl
pacman -S ifplugd

Configure the network interface.

Netctl config file is stored in /etc/netctl/your_interface_name (enp3s0 in my case)
(for DHCP)

Description='Local LAN'
Interface=enp3s0
Connection=ethernet
IP=dhcp

(for static IP)

Description='Local LAN'
Interface=enp3s0
Connection=ethernet
IP=static
Address=('192.168.1.199/24')
Gateway=('192.168.1.1')
DNS=('192.168.1.1' '192.168.1.2')
DNSDomain="your.domain"
DNSSearch="your.domain"

Install dhcpcd (not required for static IP)

pacman -S dhcpcd
systemctl enable dhcpcd

Enable the interface after creating / editing network config file) (examples can be found in /etc/netctl/examples/)

netctl enable enp3s0 

Install the grub bootloader

pacman -S grub

Create the grub directory under /boot

mkdir /boot/grub

Create the grub config

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

Installing grub for EFI
Install efibootmgr

pacman -S efibootmgr

Install the grub boot loader (the EFI directory is /efi in this configuration)

grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=grub

Install an editor:

pacman -S vim (or nano if preferred)

Set the correct locale
edit /etc/locale.gen and uncomment your character set
For UK – en_GB.UTF-8 UTF-8

vim /etc/locale.gen

Set the locale in /etc/locale.conf

LANG=en_GB.UTF-8
LC_COLLATE=C

Then run locale-gen

Install openssh

pacman -S openssh

No keys were generated during installation, so generate keys manually:

Generate SSH keys (dsa, rsa and ecdsa)

ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key

Test the sshd config

sshd -t

Start sshd

systemctl start sshd
systemctl enable sshd

Check the SSHD log for any errors

journalctl -u sshd |tail -100 or journalctl -u sshd -n 100

If you need to enable older RSA keys (to use key based authentication with older keys generated by PuTTY) add the following to /etc/ssh/sshd_config

PubkeyAuthentication yes
PubkeyAcceptedKeyTypes=+ssh-rsa

If you want a development environment

pacman -S --needed base-devel

Want to use the locate command? Install mlocate

pacman -S mlocate
updatedb
locate file_name

If using USB devices you might want the USB utilities (lsusb etc.)

pacman -S usbutils

Intalling MPD
I had issues with my MPD installation as I had specified ‘user=mpd’ and ‘group=audio’ in my /etc/mpd.conf – but this does not work with systemctl
If you are having problems starting mpd, then run the following, which will print any errors to the console

mpd --no-daemon --stdout --verbose

If your mpd starts ok, you can check output with the journalctl command

journalctl -u mpd

Install alsa utlities

pacman -S alsa-utils

Install lighttpd

pacman -S lighttpd

Set keyboard layout in /etc/vconsole.conf (my keyboard was UK yours may differ)

KEYMAP=uk

OR

echo "KEYMAP=uk" > /etc/vconsole.conf

Create /etc/hostname
add hostname to this file

echo "your_machine_hostname" > /etc/hostname

(re)create initramfs if required

mkinitcpio -P