Archlinux install guidelines

1
2
<loader readonly="yes" type="pflash">/usr/share/ovmf/x64/OVMF_CODE.fd</loader>
<nvram>/var/lib/libvirt/qemu/nvram/_archlinux-uefi_VARS.fd</nvram>

Configure live system

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
loadkeys fr
ls /sys/firmware/efi/efivars
ip link
ip addr
ping google.com -c 3
timedatectl set-ntp true
fdisk /dev/sda
mkfs.fat -F32 /dev/sda1

cryptsetup open /dev/sda2 cryptLVM
pvcreate /dev/mapper/cryptLVM
vgcreate VG /dev/mapper/crypt

pvcreate /dev/sda2
vgcreate VG0 /dev/sda2
lvcreate -L 15G VG0 -n LVroot
mkfs.ext4 /dev/VG0/LVroot
mount /dev/VG0/LVroot /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

Install essential packages

1
pacstrap /mnt base base-devel linux linux-firmware lvm2 iwd intel-ucode efibootmgr tree nano vim bash-completion man ttf-dejavu

Configure the system

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
% genfstab -U /mnt >> /mnt/etc/fstab
% arch-chroot /mnt
% ln -sf /usr/share/zoneinfo/Africe/Casablanca /etc/localtime
% hwclock --systohc
% timedatectl set-timezone Africa/Casablanca
% timedatectl set-ntp true
% sed -i '/^#en_US.UTF-8/ s/^#//' /etc/locale.gen
% sed -i '/^#fr_FR.UTF-8/ s/^#//' /etc/locale.gen
% locale-gen
% echo "LANG=fr_FR.UTF-8" > /etc/locale.conf
% echo "KEYMAP=fr" > /etc/vconsole.conf
% echo "lenovo" > /etc/hostname
% cat > /etc/hosts << EOF
127.0.0.1   localhost
127.0.1.1   lenovo.localdomain  lenovo
EOF

Initramfs

# sed -i '/^HOOKS=/ c "HOOKS=(base systemd autodetect modconf block sd-lvm2 filesystems keyboard fsck)"' /etc/mkinitcpio.conf
# mkinitcpio -P

MODULES=(vfat)
HOOKS=(base systemd autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 filesystems fsck)

Install Boot loader

# bootctl --path=/boot install
# cat > /boot/loader/loader.conf << EOF
timeout 3
default archlinux
console-mode max
EOF
# cat > /boot/loader/entries/archlinux.conf << EOF
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=/dev/linuxVG/archlinux rw quiet
EOF
# cat > /boot/loader/entries/archlinux-fallback.conf << EOF
title   Arch Linux fallback
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux-fallback.img
options root=/dev/linuxVG/archlinux rw
EOF

At the end :

# tree /boot
/boot/
├── EFI
   ├── BOOT
      └── BOOTX64.EFI
   ├── Linux
   └── systemd
       └── systemd-bootx64.efi
├── initramfs-linux-fallback.img
├── initramfs-linux.img
├── intel-ucode.img
├── loader
   ├── entries
      ├── archlinux.conf
      └── archlinux-fallback.conf
   ├── loader.conf
   └── random-seed
└── vmlinuz-linux

6 directories, 10 files

Set root password and reboot

# passwd
# exit
# umount -R /mnt
# reboot

Post-install

Create user and set password

# useradd -m -G wheel,lp -s /bin/bash -c "Fouad FAKIH" fouad 
# passwd fouad

Uncomment the following line %wheel ALL=(ALL) ALL to allow members of wheel group to run sudo commands :

EDITOR=nano visudo

Optional disable root login

# passwd -l root

Manual network configuration

ip addr
ip link set enp1s0 up
ip address add 192.168.122.2/24 broadcast + dev enp1s0
ip addr
ip route add default via 192.168.122.1 dev enp1s0
echo "nameserver 192.168.122.1" >> /etc/resolv.conf
ping archlinux.org

Fetching and ranking a live mirror list

# pacman -S pacman-contrib
$ curl -s "https://www.archlinux.org/mirrorlist/?country=FR&country=GB&country=DE&protocol=https&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' | rankmirrors -n 10 -
Server = https://mirror.pkgbuild.com/$repo/os/$arch
Server = https://appuals.com/archlinux/$repo/os/$arch
Server = https://archlinux.mailtunnel.eu/$repo/os/$arch
Server = https://mirrors.eric.ovh/arch/$repo/os/$arch
Server = https://mirrors.arnoldthebat.co.uk/archlinux/$repo/os/$arch
Server = https://mirror.wormhole.eu/archlinux/$repo/os/$arch
Server = https://archlinux.uk.mirror.allworldit.com/archlinux/$repo/os/$arch
Server = https://mirror.selfnet.de/archlinux/$repo/os/$arch
Server = https://mirror.cyberbits.eu/archlinux/$repo/os/$arch
Server = https://mirrors.celianvdb.fr/archlinux/$repo/os/$arch
Server = https://mirror.oldsql.cc/archlinux/$repo/os/$arch
Server = https://arch-mirror.cloud.louifox.house/$repo/os/$arch

Gnome desktop

# pacman -S gnome
# systemctl enable gdm.service
# systemctl reboot

Enable essential services

Optinal if Virtual machine

spice-vdagent
enable spice-vdagentd.service

qemu-guest-agent
enable qemu-ga.service

Networking

$ systemctl enable --now NetworkManager.service
$ sudo pacman -S systemd-resolvconf usb_modeswitch

Using systemd-resolved for dns

$ systemctl enable --now systemd-resolved.service
$ sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf

Using iwd instead of wpa_supplicant

printf '%s\n' '[device]' 'wifi.backend=iwd' >/etc/NetworkManager/conf.d/wifi_backend.conf
systemctl disable wpa_supplicant.service
systemctl mask wpa_supplicant.service

Enable Disk trim for SSD drives

systemctl enable fstrim.timer

Software manager

Install gnome-software-packagekit-plugin if you want to use gnome-software for applications management.

# pacman -S gnome-tweaks dconf fragments seahorse flatpak fwupd

Pamac install

curl -L -O https://aur.archlinux.org/cgit/aur.git/snapshot/pamac-aur.tar.gz
curl -L -O https://aur.archlinux.org/pamac-aur.git
tar xzf pamac-aur.tar.gz
cd pamac-aur
makepkg -sic

Enable AUR

# sed -i '/EnableAUR/ s/^#//' /etc/pamac.conf
# sed -i '/CheckAURUpdates/ s/^#//' /etc/pamac.conf

Gnome Packages

Graphics Install

sudo pacman -S --needed mesa-demos vulkan-radeon vulkan-tools vulkan-intel vulkan-mesa-layer
sudo pacman -S --needed libva-utils libva-mesa-driver libva-intel-driver ##intel-media-driver
sudo pacman -S gst-libav gst-plugins-ugly gstreamer-vaapi

Official repositories

pacman -S gnome gnome-tweaks dconf fragments seahorse
pacman -S gnome-software-packagekit-plugin flatpak fwupd
systemctl enable gdm.service

Networking

systemctl enable NetworkManager.service
systemctl enable --now systemd-resolved.service
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
pacman -S systemd-resolvconf usb_modeswitch
systemctl disable wpa_supplicant.service
systemctl mask wpa_supplicant.service

Bluetooth

systemctl enable bluetooth.service
pacman -S bluez-utils
gpasswd -a fouad lp

Printing

pacman -S --needed cups cups-pdf cups-pk-helper ghostscript gsfonts gutenprint hplip python-gobject python-pyqt5 splix system-config-printer
systemctl enable --now org.cups.cupsd.service
#gpasswd -a fouad sys

Virtualization

pacman -S virt-manager ovmf firewalld dmidecode dnsmasq
systemctl enable --now firewalld.service
PKG_LIST="papirus-icon-theme rsync p7zip lsb-release"
pacman -S $PKG_LIST

Office applications

pacman -S --needed libreoffice-fresh-fr libmythes mythes-{fr,es,en} hunspell hunspell-{en_GB,en_US,es_es,fr} hyphen hyphen-{en,es,fr}
pamac install libreoffice-extension-grammalecte-fr

AUR packages

pamac install nautilus-admin
pamac install gtkhash gtkhash-nautilus
pamac install gtkhash-nautilus

For gtkhash edit PKGBUILD file and remove unecessary file managers.

To load nautilus plugins force quit nautilus if running with :

nautilus -q

Gnome Tweaks

Enable suspend-then-hibernate on Lid close

# mkdir /etc/systemd/logind.conf.d/
# printf '%s\n' '[Login]' 'NAutoVTs=3' 'HandleLidSwitch=suspend-then-hibernate' 'HandleLidSwitchExternalPower=lock' >/etc/systemd/logind.conf.d/50-local.conf
$ cat /etc/systemd/logind.conf.d/50-local.conf 
[Login]
NAutoVTs=3
HandleLidSwitch=suspend-then-hibernate
HandleLidSwitchExternalPower=lock

Adjust the delay to enter hibernate mode (Default 180min)

# mkdir /etc/systemd/sleep.conf.d/
# printf '%s\n' '[Sleep]' 'HibernateDelaySec=30min' >/etc/systemd/sleep.conf.d/suspend-then-hibernate.conf
$ cat /etc/systemd/sleep.conf.d/suspend-then-hibernate.conf 
[Sleep]
HibernateDelaySec=30min

Enable tap to click in GDM

$ sudo -u gdm dbus-launch gsettings set org.gnome.desktop.peripherals.touchpad tap-to-click true
https://www.archlinux.org/art/
https://sources.archlinux.org/other/artwork/archlinux-logo-{light,dark,black,white}-{scalable.svg,1200dpi.png,90dpi.png}
mkdir -p /usr/share/archlinux/artwork
https://sources.archlinux.org/other/artwork/archlinux-artwork-1.6.tar.gz
$ sudo -u gdm dbus-launch gsettings set org.gnome.login-screen logo '/usr/share/archlinux/artwork/archlinux-logo-light-1200dpi.png'

Setting Alt-Tab Behaviour

From application to window switcher

gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]"
gsettings set org.gnome.desktop.wm.keybindings switch-windows "['<Super>Tab', '<Alt>Tab']"
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward  "['<Shift><Super>Tab', '<Shift><Alt>Tab']"

SWitching applications in current workspace only

$ gsettings set org.gnome.shell.app-switcher current-workspace-only true
$ sudo systemctl enable avahi-daemon.service

Desktop packages

pacman -S nextcloud-client python-nautilus
pacman -S firefox firefox-i18n-fr

Share on: RedditLinkedInTwitterFacebookEmail


Related Posts


Reading Time

~4 min read

Published

Category

Linux

Tags

Contact