Preparation and Installation of the base system
- Connect the USB drive and boot from the Arch Linux ISO
- Make sure the system is booted in UEFI mode. The following command should display the directory contents without error
ls /sys/firmware/efi/efivars
- Connect to the internet (if not already). Assuming wireless:
iwctlstation <interface> scanstation <interface> get-networksstation <interface> connect <network-name>
- Run
fdiskto create Linux partitionsfdisk /dev/<your-disk>- Create an empty GPT partition table using the
gcommand# WARNING: This will erase the entire disk.Command (m for help): gCreated a new GPT disklabel (GUID: ...)
- Create the EFI partition (
/dev/<your-disk-efi>)Command (m for help): nPartition number: <Press Enter>First sector: <Press Enter>Last sector, +/-sectors or +/-size{K,M,G,T,P}: +250MCommand (m for help): tPartition type or alias (type L to list all): uefi
- Create the Boot partition (
/dev/<your-disk-boot>)Command (m for help): nPartition number: <Press Enter>First sector: <Press Enter>Last sector, +/-sectors or +/-size{K,M,G,T,P}: +512MCommand (m for help): tPartition type or alias (type L to list all): linux
- Create the LUKS partition (
/dev/<your-disk-luks>)Command (m for help): nPartition number: <Press Enter>First sector: <Press Enter>Last sector, +/-sectors or +/-size{K,M,G,T,P}: <Press Enter>Command (m for help): tPartition type or alias (type L to list all): linux
- Print the partition table using the
pcommand and check that everything is OKCommand (m for help): p
- Write changes to the disk using the
wcommand. (Make sure you know what you’re doing before running this command)Command (m for help): w
- Format the EFI and Boot Partitions
mkfs.fat -F 32 /dev/<your-disk-efi>mkfs.ext4 /dev/<your-disk-boot>
- Set up the encrypted partition. You can choose any other name instead of
cryptlvmcryptsetup --use-random luksFormat /dev/<your-disk-luks>cryptsetup luksOpen /dev/<your-disk-luks> cryptlvm
- Create an LVM volume group
pvcreate /dev/mapper/cryptlvmvgcreate vg0 /dev/mapper/cryptlvm
- Create LVM partitions; We create logical volumes for swap, root (
/), and home (/home). Leave 256MiB of free space in the volume group because thee2scrubcommand requires the LVM volume group to have at least 256MiB of unallocated space to dedicate to the snapshot.lvcreate --size 4G vg0 --name swaplvcreate -l +100%FREE vg0 --name rootlvreduce --size -256M vg0/root
- Format logical volumes
mkswap /dev/vg0/swapmkfs.ext4 /dev/vg0/root
- Mount new filesystems
mount /dev/vg0/root /mntmount --mkdir /dev/<your-disk-efi> /mnt/efimount --mkdir /dev/<your-disk-boot> /mnt/bootswapon /dev/vg0/swap
- Install the base system. We also install some useful packages like
git,vim, andsudopacstrap -K /mnt base linux linux-firmware openssh git vim sudo
- Generate
/etc/fstab. This file can be used to define how disk partitions, various other block devices, or remote filesystems should be mounted into the filesystemgenfstab -U /mnt >> /mnt/etc/fstab
- Chroot into the new system
arch-chroot /mnt /bin/bash
- Set TimeZone
ln -s /usr/share/zoneinfo/<Region>/<City> /etc/localtime
- Run hwclock(8) to generate
/etc/adjtimehwclock --systohc
- Set Locale
vim /etc/locale.gen #uncomment en_US.UTF-8 UTF-8locale-genecho LANG=en_US.UTF-8 > /etc/locale.conf
- Set hostname
echo <new-hostname> /etc/hostname
- Create a user
useradd -m -G wheel --shell /bin/bash <your-username>passwd <your-username>visudo # ---> Uncomment "%wheel ALL=(ALL) ALL"
- Configure
mkinitcpiowith modules needed to create the initramfs imagepacman -S lvm2vim /etc/mkinitcpio.conf# ---> Add 'encrypt' and 'lvm2' to HOOKS before 'filesystems'mkinitcpio -P
- Setup GRUB
pacman -S grub efibootmgrgrub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
In/etc/default/grubedit the line GRUB_CMDLINE_LINUX as follows. Don’t forget to replace/dev/<your-disk-luks>with the appropriate path.GRUB_CMDLINE_LINUX="cryptdevice=/dev/<your-disk-luks>:cryptlvm root=/dev/vg0/root"
Now generate the main GRUB configuration filegrub-mkconfig -o /boot/grub/grub.cfg
- Install
networkmanagerpackage and enableNetworkManagerservice to ensure you have Internet connectivity after rebootingpacman -S networkmanagersystemctl enable NetworkManager
- Exit new system and unmount all filesystems
exitumount -R /mntswapoff -a
Arch has been installed! Rebootreboot
Configuration of NetworkManager
- Run
nmtuifrom console - Connect to desired WiFi network, supplying passphrase
Installation of yay (AUR)
sudo pacman -S base-devel git --neededcd ~git clone https://aur.archlinux.org/yay.gitcd yaymakepkg -si
Installation of Cinnamon (optional)
- After reboot, login
- Install Cinnamon and some basic extras
sudo pacman -S cinnamon nemo-fileroller xdg-user-dirs gnome-terminal gnome-system-monitor gnome-screenshot lightdm lightdm-gtk-greeter lightdm-gtk-greeter-settings lightdm-slick-greeter
- You can either roll with the default greeter, or install slick-greeter
sudo vim /etc/lightdm/lightdm.conf- Look for
greeter-sessionand change its valuegreeter-session=lightdm-slick-greeter - Save and quit vim
- Reboot
Installation of KDE (optional)
- Install Plasma
sudo pacman -S plasma-meta kde-applications-meta kde-gtk-config
- SDDM (KDE Display manager)
sudo pacman -S sddm sddm-kcmsudo systemctl enable sddm
- Enable Network and Bluetooth
sudo systemctl enable NetworkManagersudo systemctl enable bluetooth
- Reboot
And there you have it! Arch Linux with your Desktop of choice. Enjoy!
