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, usetimedatectl
)
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 asmkfs.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
withnano /etc/locale.gen
. Delete the # sign at the beginning and save the file then generate them withlocale-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
andsystemctl 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
Orgnome 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
andsudo 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
thenMAKEFLAGS
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 commandgpg
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 runsudo 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:
-
First install
alsa-utils
, then run:$ alsamixer
and unmute the volume. -
Then install pulseaudio pulseaudio-alsa pulseaudio-bluetooth pulseaudio-equalizer pulseaudio-jack
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