Installing Arch Linux

Here is how you can recreate my Arch system. Some properties are:

I. Pre-boot

Installation guide

1. Get an ISO from a mirror.

2. Get the signature from the Arch Downloads page.

3. Verify the ISO with `pacman-key -v *.iso.sig`.

4. Check the name of the USB key with `lsblk`. I assume it is /dev/sdb.

5. Move the ISO to the USB key with `cat *.iso > /dev/sdb`.

II. Boot

1. Boot from the USB key.

2. Run `loadkeys de-latin1`.

3. Check `ls /sys/firmware/efi/efivars`.

4. Use `iwctl` to get a wireless internet connection. Inside iwctl, do:

5. Check `ping archlinux.org`.

6. Check `timedatectl status`.

III. Partition the disk

1. Check the name of the disk with lsblk. I assume it is /dev/sdb.

2. Use `fdisk /dev/sdb` to partition the disk like so:

a. Create a new GPT.

b. Create a first partition of size 512M.

c. Let the first partition be of type C12A7328-F81F-11D2-BA4B-00A0C93EC93B (EFI system).

d. Create a second partition.

e. Let the second partition be of type 4F68BCE3-E8CD-4DB1-96E7-FBCAF984B709 (Linux x86-64 root).

f. Let the second partition have the label “Root”.

g. Print and verify the partition table.

h. Write.

IV. Format and mount root, boot, and swap

1. Check the name of the root partition with lsblk. I assume it is /dev/sdb2.

2. Format and mount the root partition like so:

3. Check the name of the boot partition with lsblk. I assume it is /dev/sdb1.

4. Format and mount the boot partition like so:

5. Make, format, and activate the swap file like so:

V. Installation

1. Check /etc/pacman.d/mirrorlist.

2. Run `pacstrap -K /mnt base linux linux-firmware nano man-db man-pages texinfo`.

VI. Post-installation

1. Run `genfstab -U /mnt >> /mnt/etc/fstab`.

2. Check /mnt/etc/fstab. It should look something like this:

3. Run `arch-chroot /mnt`.

4. Run `ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime`.

5. Run `hwclock --systohc`.

6. Uncomment `en_US.UTF-8 UTF-8` and `de_DE.UTF-8 UTF-8` in /etc/locale.gen.

7. Run `locale-gen`.

8. Write `LANG=de_DE.UTF-8` to /etc/locale.conf.

9. Write `KEYMAP=de-latin1` to /etc/vconsole.conf.

10. Write a hostname to /etc/hostname.

11. Edit /etc/hosts. It should look like this:

12. Run `pacman -S networkmanager`.

13. Run `systemctl enable NetworkManager.service`.

14. Edit /etc/mkinitcpio.conf. It should have lines like this:

15. Run `mkinitcpio -P`.

16. Use `passwd` to set a root password.

VII. Boot loader and microcode

1. Run `bootctl install`.

2. Check the CPU brand with lscpu.

3. Run `pacman -S intel-ucode` for an Intel CPU or `pacman -S amd-ucode` for an AMD CPU.

4. Edit /boot/loader/loader.conf. Do not use tabs. It should look something like this:

5. Check the UUID of the root partition with `lsblk -f`.

6. Edit /boot/loader/entries/arch.conf. Do not use tabs. It should look something like this:

a. Replace `initrd /intel-ucode.img` with `intrd /amd-ucode.img` for an AMD CPU.

b. If you have installed `linux-lts` instead of `linux`, replace `linux /vmlinuz-linux` with `linux /vmlinuz-linux-lts` and `initrd /initramfs-linux.img` with `initrd /initramfs-linux-lts.img`.

7. Run `systemctl enable systemd-boot-update.service`.

VIII. Reboot

1. Run `exit`.

2. Run `reboot`.

General recommendations

IX. Users

1. Run `useradd -m -G wheel USERNAME`.

2. Use `passwd USERNAME` to set the password of the user.

3. Use `chfn USERNAME` to set the full name of the user.

4. Run `pacman -S sudo`.

5. Use `EDITOR=nano visudo` to uncomment `%wheel ALL=(ALL:ALL) ALL` in /etc/sudoers.

6. Run `exit`.

7. Log in as the new user.

X. Basic services

1. Run `pacman -S pacman-contrib`.

2. Run `systemctl enable paccache.timer`.

3. Run `timedatectl set-ntp true`.

4. Check `timedatectl status`.

5. Run `pacman -S firewalld`.

6. Run `systemctl enable firewalld.service`.

7. Run `pacman -S pkgstats`.

8. Check `systemctl status pkgstats.timer`.

9. Run `pacman -S xdg-user-dirs`.

10. Check `systemctl status xdg-user-dirs-update.service`.

XI. Xorg

Xorg

1. Run `pacman -S xorg-server`.

2. Check the GPU brand with `lspci -v | grep -A1 -e VGA -e 3D`.

3. Run `pacman -S xf86-video-intel` for an Intel GPU or `pacman -S xf86-video-amdgpu` for an AMD GPU.

4. Run `pacman -S mesa`.

EOF