Arch installation (The process)

Here’s how I used to install Arch (Arch install guide from a beginners perspective.) Knowing the process has helped me have a better understanding about the OS, so I thought it could be beneficial to make a post about it. Bare in mind when I first tried to install Arch Linux I didn’t even know the cd .. command. These are my refined up to date notes.

  • loadkeys uk (set the keyboard layout, only for installation session)

Verify the boot mode

  • list the efivars directory. If the directory does not exist, the system may be booted in BIOS or CSM mode. Refer to your motherboard’s manual for details. If UEFI mode is enabled on an UEFI motherboard, Archiso will boot Arch Linux accordingly via systemd-boot. To verify this, list the efivars directory:

  • ls /sys/firmware/efi/efivars

  • Use ethernet to connect to the internet.

Update the system clock

  • timedatectl set-ntp true (To check the service status, use timedatectl)

Partition the disks

  • fdisk -l (list the drives and type)

  • fdisk /dev/nvme0n1 (select and partition main ssd)

  • Help = m

  • Create a new gpt table with g UEFI with GPT, BIOS with MBR

  • create 3 partitions. 1) Boot partition 512M (EFI system), 2) swap partition (linux swap), 3) root partition linux root x86-64 (rest of the disk space)

  • for First sector always hit enter (not counting sectors)

  • make the 3 partitions with their sizes first and then apply the type.

  • Lsblk (show drives, size, mount point)

  • lsblk -f (shows filesystem type)

Format drives

  • Format boot and root partition and make swapon. Create two file systems and enable the swap partition.

  • Boot partition file system (efi system) must be fat32 file system. (mkfs.fat supports creating FAT12, FAT16 and FAT32)

  • mkfs.fat -F32 /dev/nvme0n1p1

  • mkfs.fat is the same as mkfs.vfat

  • mkswap /dev/nvme0n1p2

  • swapon /dev/nvme0n1p2

  • root partition (the bulk of the space) is ext4 filesystem mkfs.ext4 /dev/nvme0n1p3

Mount file system

  • mount the root partition to /mnt. mount /dev/nvme0n1p3 /mnt

  • make the place/directory for the boot partition to be mounted mkdir -p /mnt/boot/EFI At first from following the wiki I used to mount the esp to /mnt/boot/efi but with that setup I noticed an error whilst restoring from a timeshift backup. I found online somewhere someone saying to use /mnt/boot/EFI. When I used the new mount point the timeshift errors didn’t reoccur.

mount the boot partition mount /dev/nvme0n1p1 /mnt/boot/EFI

Install essential packages (I just found this list from what someone else installed when they went through their installation)

  • pacstrap /mnt base base-devel linux linux-firmware linux-lts linux-lts-headers networkmanager wpa_supplicant network-manager-applet wireless_tools dialog vi vim nano intel-ucode man-db man-pages inetutils netctl dhcpcd s-nail bash bzip2 coreutils cryptsetup diffutils e2fsprogs file filesystem findutils

Configure the system

  • genfstab -U /mnt >> /mnt/etc/fstab ( generate fstab file)

  • cat /mnt/etc/fstab (to check the fstab file)

Chroot

  • arch-chroot /mnt (change-root)

  • ln -sf /usr/share/zoneinfo/Europe/London /etc/localtime (Time zone)

  • hwclock --systohc (set the clock)

  • Un-comment en_GB.UTF-8 with nano /etc/locale.gen. Delete the # sign at the beginning and save the file then generate them with locale-gen

  • Create the locale.conf file, and set the

LANG

variable accordingly:

nano /etc/locale.conf edit with: LANG=en_GB.UTF-8

Or

  • echo ‘LANG=en_GB.UTF-8’ > /etc/locale.conf (another way of doing it, the echo command is for a command that has a variable in it)

  • nano /etc/vconsole.conf edit with: KEYMAP=uk

  • Network configuration create the hostname file nano /etc/hostname edit with: hostname

Or

  • echo myhostname > /etc/hostname

Add matching entries to hosts(5):

nano /etc/hosts

127.0.0.1     localhost 
::1           localhost 
127.0.1.1     hostname.localdomain hostname
  • the above ip address is a personal ip address for testing the network card and all computers can use 127.0.0.1. anything that begins with 127 is a loopback address.

  • Set the Root password - passwd

  • The wifi can be configured after the installation of Grub and rebooting into the new system with Network Manager.

  • Install GRUB: sudo pacman -S grub efibootmgr

  • grub-install --target=x86_64-efi --efi-directory=/boot/EFI --bootloader-id=GRUB

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

Post installation

  • Set up wifi

  • ip link (check internet connection)

  • pacman -Syu

  • systemctl status dhcpcd.service (stop/disable the service if necessary)

  • systemctl disable dhcpcd.service and systemctl stop dhcpcd.service

  • systemctl enable --now NetworkManager.service

  • nmcli device wifi list

  • nmcli device wifi connect [SSID] password [........]

Create a new user

  • useradd -m -G wheel -s /bin/bash [Username]

  • passwd [Username]

  • visudo (uncomment wheel group)

Install Desktop Environment

  • sudo pacman -Syu

  • sudo pacman -S xorg xorg-server xorg-xinit xf86-video-intel mesa lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings Or gnome gnome-extra

  • systemctl enable lightdm

Or

  • systemctl enable gdm.service

Rerun:

sudo timedatectl and then if needed

sudo timedatectl set-ntp true and sudo hwclock --systohc

Setup UFW & TLP

  • sudo pacman -S ufw tlp

  • sudo systemctl enable --now tlp.service

  • sudo systemctl enable --now ufw.service

  • sudo ufw default deny

  • sudo ufw allow from 192.168.0.0/24

  • sudo ufw allow Deluge

  • sudo ufw limit ssh

  • sudo ufw enable

Install some packages

  • sudo pacman -S --needed adobe-source-sans-pro-fonts aspell-en enchant gst-libav gst-plugins-good icedtea-web jre8-openjdk languagetool libmythes mythes-en pkgstats ttf-anonymous-pro ttf-bitstream-vera ttf-dejavu ttf-droid ttf-liberation ttf-ubuntu-font-family libreoffice-fresh-en-gb libreoffice-extension-writer2latex ttf-caladea ttf-carlito ttf-dejavu ttf-liberation ttf-linux-libertine-g noto-fonts adobe-source-code-pro-fonts adobe-source-sans-pro-fonts adobe-source-serif-pro-fonts hunspell hunspell-en_GB hyphen hyphen-en libmythes mythes-en virtualbox virtualbox-host-dkms dmidecode base-devel git gvim vlc htop neofetch gimp cheese plank

  • sudo modprobe vboxdrv and sudo usermod -aG vboxusers [Username]

For AUR packages

  • sudo nano /etc/makepkg.conf (uncomment and edit this file so that all cpu threads are used whilst making packages)

  • change: MAKEFLAGS="-j2" to: MAKEFLAGS="-j$(nproc)"

  • in nano you can search for a word Ctrl+w then MAKEFLAGS hit Enter.

  • nproc (will show you how many threads are in your system)

  • cd ~/Builds then: git clone [package AUR link] (create Builds directory then git clone package you want from the AUR in that directory)

  • cd [package-name] ; ls then check content of PKGBUILD (eg installing spotify you should check in the PKGBUILD that all of the source links lead to the spotify website)

  • read: https://wiki.archlinux.org/index.php/PKGBUILD to learn more about checking the PKGBUILD.

  • makepkg -si

  • Acquiring a PGP public key if needed. If a package needs a pgp key so the package can be made, and if the pgp key isn’t in the users keyring then the installer will abort the installation with an error message stating that the pgp key could not be verified.

  • the PKGBUILD will most likely contain a validpgpkeys entry with the required key IDs

  • If .gnupg isn’t in home, just run the command gpg and it will be created.

  • nano ~/.gnupg/gpg.conf edit with: keyserver-options auto-key-retrieve

  • nano ~/.gnupg/dirmngr.conf edit with: keyserver hkp://keys.gnupg.net

Install some AUR packages with yay

  • yay -S geteltorito

  • yay -S timeshift

  • sudo pacman -S cronie and run sudo systemctl enable --now cronie.service

  • yay -S google-chrome

  • yay -S libreoffice-extension-languagetool

  • yay -S simplenote-electron-bin

Keyboard layout

  • before making changes:

  • localectl status (to see how the vconsole and X11 are set up)

  • rm /etc/vconsole.conf (if needed)

  • rm /etc/x11/xorg.conf.d/00-keyboard.conf (if needed)

  • nano /etc/vconsole.conf (to change the vconsole) edit with: KEYMAP=uk FONT=uk

  • sudo localectl set-x11-keymap gb

  • (to change x11) localectl doesn’t work with gnome or kde. for those two DE the global keyboard is changed in the desktop settings.

  • localectl set-locale LANG="en_GB.UTF-8"

Audio

  • The audio should work out the box on gnome as long as the user is added correctly.

for xfce4:

USB and auto mount helper

  • Install udisks2 and configure it to mount to `/media

  • sudo pacman -S udiskie udisks2

  • nano .xprofile edit with /usr/bin/udiskie &

  • nano /etc/udev/rules.d/99-udisks2.rules edit with:


# UDISKS_FILESYSTEM_SHARED
# ==1: mount filesystem to a shared directory (/media/VolumeName)
# ==0: mount filesystem to a private directory (/run/media/$USER/VolumeName)
# See udisks(8)
ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{UDISKS_FILESYSTEM_SHARED}="1"

  • nano /etc/tmpfiles.d/media.conf edit with: D /media 0755 root root 0 -

  • For the Usb tray icon:

  • mkdir -p .config/udiskie/config.yml

  • nano .config/udiskie/config.yml edit with:


program_options:
  # Configure defaults for command line options

  tray:             auto    # [bool] Enable the tray icon. "auto"
                            # means auto-hide the tray icon when
                            # there are no handled devices.

  menu:             flat    # ["flat" | "nested"] Set the
                            # systray menu behaviour.

  automount:        false   # [bool] Enable automatic mounting.

  notify:           true    # [bool] Enable notifications.

This was a very long and painful, but extremely beneficial experience for me.

Regards,

Muj

12 Likes

New task at hand - install arch the arch way . Thanks for this explanation . I wouldn’t consider installing arch the arch way ever . But reading this changed that :innocent:

It definitely helps in getting to grips with how the OS comes together and what does what. It is a good learning process. :smile:

2 Likes

It will be fun for me to see all the error messages when I am done :rofl: :innocent:

Well , I literally do everything for fun :grin:

I’ve done it a few times but would never consider ever doing it again. Arch way = 45 minutes and a second computer needed so I don’t forget steps. Endeavour = 10 minutes. Yeah, I know which way 100% of my installs are being done. :smiley:

1 Like

Thank you for taking the time to write this up :+1:

5 Likes

But, always remember, if you follow this guide you don’t have an Arch install. Arch installs are only Arch installs when you follow the wiki :wink:

1 Like

lol I must have done it over 50 times i’d reckon. Hahaha I remember the first time I finished the installation and then after working out how to use NetworkManager when I got my wifi working, wow, that was a moment of pure jubilation. I jumped out laptop in hand calling to my wife telling her about my achievement. haha, she was not bothered/interested at all.

And every time when I messed up my system having to reinstall, again. Have to love the learning process, only makes you stronger.

I definitely agree though EnOS is the way. The other day after not being happy with the way I dealt with .vimrc and not having a backup from timeshift of roots hidden files I easily (stress free) just re-installled and started again.

I very much appreciate EnOS’s installer.

For me I made the guide from the wiki and parts I couldn’t understand I got else where. :wink:

I would love to be able to help people the way you are able to with the knowledge that you have. I’m just doing what I can with my capability at the moment (and the spare time I have at the moment.) :+1:

3 Likes

…“second computer needed …”
I discovered Lynx, then I didn’t need another computer, just another virtual terminal.

Iwctl

device list

Station “ name of your WiFi adapter “ scan

Station “ name of your adapter “ get-networks

Station “ name of your adapter “ “ Enter your network name “ connect

Fill in password .

That from July for arch install for WiFi connection :wink::blush:

1 Like

Yeah, getting wifi to work during installation is too much of a pita for me, so install, move to where I can hardwire, install networkmanager. I’m past the days of youth of being “HARD CORE” and doing everything the hard way. Nowadays I just want things to work, so NetworkManager, Plasma, PulseAudio, etc. are all good things to me.

Although I think installing Arch the Arch way is a good way to learn Arch, but I prefer EndeavourOS or something like Archfi over installing Arch with the wiki nowadays.

2 Likes

Thank you for that, I noticed it somewhere, probably one time whilst looking back at the installation guide.

lol I’ve never been hardcore, always have chosen ethernet cabe and NetworkManager.

:smile:

Does anyone know about the issue I had with the mount point for the esp? When I mounted to /mnt/boot/efi there were errors with timeshift restore, and when I mounted to /mnt/boot/EFI no errors when reinstalling from a timeshift backup. As far as I understood the wiki says to mount to /mnt/boot/efi. It looks like EnOS is mounted to /mnt/boot/efi and no errors whilst using timeshift.

@muj
I miss type … it iwctl

i normally do " mkdir -p /mnt/boot/efi " then " mount /dev/sda1 /mnt/boot/efi "

Yeah, I used to do that which I got from the wiki but I noticed errors coming up when doing a timeshift restore. And when changing it to /mnt/boot/EFI the errors went away.

No worries. It’s theoretical now, can’t reproduce it.

MBR partitioning → fdisk
GPT partitioning → gdisk

Very useful: a separate /home partition.

Btw., this Wiki article is not enough?

1 Like

I’ve always just used fdisk with the ‘g’ option. Do you think that’s the reason I got some errors with timeshift. But I used fdisk with /mnt/boot/EFI and I didn’t get any errors with timeshift.

i always use separate /home … @axt Useful very :+1:

Edit … cfdisk is ok

Why’s a separate home partition useful? How much space would you give to home and then root?

Considering the default .vimrc being empty, I would consider reinstalling the whole system to start over with a nonexisting .vimrc slightly overkill, :rofl:.

Even if the install process is so much easier than the “Arch way”,

you need to fight your install addiction, :wink: .