εηͺ
#001
6th May 2022 /
Archlinux Installation Guide: Step by Step
Tips / Installation / Archlinux
ISOS
π First download the official ISO from Here
π Write the ISO to a USB:
# If we're using another Linux distro we can do the following
fdisk -l # to find the USB partition
dd if=$HOME/Downloads/archlinux-version-xxx.iso of=/dev/sdX bs=1M # bs=1M is optional
If weβre using Windows we can use Rufus
Boot from USB and install the BASE
π
Next, we need to restart from the USB. Normally with F2
or
Del
we should be able to enter the BIOS and select the USB.
π Boot Archlinux and continue
π
Configure the keyboard layout with loadkeys us
If you donβt use a US keyboard
you can check which layout to use with: ls -R /usr/share/kbd/keymaps
π Enable parallel downloads.
nano /etc/pacman.conf
# Uncomment the "ParallelDownloads" option and specify the number we want. In my case five seems perfect.
ParallelDownloads = 5
π Save with:
Ctrl
+ o
& Ctrl
+ x
π Update the repositories
pacman -Syy
π Partitions:
NOTE: In my case, I keep the disk without dual boot, I only have one operating system which is Archlinux/Artix. But Iβll show the method I use if I need to keep Windows (for some reason!)
# with fdisk I check the partition names
fdisk -l
# Create the /boot folder and delete the previous boot from the distro I normally have
mkdir -p /mnt/boot/
mount /dev/nvme0n1p1 /mnt/boot/
I do this step to avoid having to create another EFI partition, I use the same one as Windows, and I donβt format this partition
# delete the archlinux boot entries
rm {*.img}
rm vmlinuz-linux
rm -rf grub/
rm -rf EFI/arch/
Leaving the EFI/Microsoft folder untouched
π
Then format the partition where the root will go mkfs.btrfs -F /dev/nvme0n1p5/
and continue with the installation.
π Partition the disk:
π Note: In my case my disk is NVME, so replace NVME with sda, sdb or whatever you have.
cfdisk /dev/nvme0n1
Start Size
/dev/nvme0n1p1 512M # 512M / 1GB recommended
/dev/nvme0n1p2 60G # 40/60GB
/dev/nvme0n1p3 405.3G # The rest of the space
π Note: This installation is exclusively for UEFI, and also consider that Iβm not using dual boot. Just arch/artix.
π Format the partitions:
# In this case I use xfs for my home and root partition. You can choose btrfs or ext4...
mkfs.xfs -L ROOT /dev/nvme0n1p2 # Root partition
mkfs.xfs -L HOME /dev/nvme0n1p3 # Home partition (optional)
mkfs.fat -F 32 /dev/nvme0n1p1 # EFI/boot partition
fatlabel /dev/nvme0n1p1 EFI
π Mount the partitions:
mount /dev/disk/by-label/ROOT /mnt
mkdir -p /mnt/boot
mkdir -p /mnt/home
mount /dev/disk/by-lable/HOME /mnt/home
mount /dev/disk/by-label/EFI /mnt/boot
Install the base:
pacstrap /mnt base base-devel linux linux-firmware nano dhcpcd
π Generate the fstab file
genfstab -U /mnt >> /mnt/etc/fstab
Configuring our system
π Change to root in our system
arch-chroot /mnt
π Configure the clock
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime # Here we need to put the region/city.
π Note: With hwclock we generate /etc/adjtime
hwclock --systohc
π Generate the locales
# Uncomment whichever you prefer. I prefer the system in English
nano /etc/locale.gen
locale-gen
# Here we can edit the file and select our favorite
nano /etc/locale.conf
LANG=en_US.UTF=8 # in my case, I prefer en_US
nano /etc/vconsole.conf
KEYMAP=us
π Install the bootloader:
pacman -S grub efibootmgr
π Note 3: My configuration is designed for UEFI systems. Pay attentionβ¦
π Install grub:
# If you're using MBR and not UEFI:
# grub-install --recheck /dev/sda
grub-install --target=x86_64-efi --efi-directory=/boot --recheck
grub-mkconfig -o /boot/grub/grub.cfg
π Set the ROOT password:
passwd # when you hit enter, type the password.
useradd -m -G wheel -s /bin/bash yourusername # Obviously, type your username here!
passwd yourusername
π Add WHEEL to sudoers file:
EDITOR=nano visudo
# uncomment: (removing the #)
%wheel ALL=(ALL:ALL) ALL
π Configure the hostname:
nano /etc/hostname
# hostname is giving a name to the host:
# I like "aesthetic" So it can be like your nickname.
π Add it to hosts:
::: code-output-flex
nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 yourhostname.localdomain yourhostname
# replace "yourhostname" with the hostname you chose.
:::
π Install DHCPCD (internet client):
pacman -S dhcpcd dhcpcd-dinit
π Unmount and reboot:
exit # To exit su
exit # To exit chroot
umount -R /mnt # To unmount
reboot # To reboot
At this point after rebooting and not getting any errors or issues, it means you have finished installing the base Archlinux system.
Iβd like to leave you with some additional steps (tips) that helped me when I didnβt understand anything.
π Enable DHCPCD to have internet:
sudo systemctl enable dhcpcd
sudo systemctl start dhcpcd
π
Install paru: If we donβt have git, we need to install it
sudo pacman -S git wget
.
git clone https://aur.archlinux.org/paru.git
cd paru
makepkg -si
π Finally, some packages that will be useful:
# Handle zip, rar files.
sudo pacman -S zip unzip unrar
# Alsa and pipewire for audio
sudo pacman -S pipewire pipewire-alsa pipewire-pulse alsa-utils
# To be able to view external disks
sudo pacman -S ntfs-3g dosfstools exfat-utils
# Intel / AMD drivers
paru -S xf86-video-amdgpu vulkan-radeon mesa-libgl mesa-vdpau libvdpau-va-gl libva-mesa-driver #AMD
paru -S xf86-video-intel mesa-libgl libvdpau-va-gl #Intel
Well, thatβs all. I hope it helped you. If you made it this far, please check out my other posts.
````` ``````