品η•ͺ

#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.

````` ``````