How to Install Arch Linux: A Calm, No-Nonsense Guide

The CyberSec Guru

How to Install Arch Linux A Calm, No-Nonsense Guide

If you like this post, then please share it:

Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Why your support matters: Zero paywalls: Keep the main content 100% free for learners worldwide, Writeup Access: Get complete in-depth writeup with scripts access within 12 hours of machine drop.

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

Arch Linux is renowned for its simplicity, flexibility, and being a cornerstone of Linux enthusiasts’ exploration into operating systems. However, its installation process often intimidates newcomers. This comprehensive guide demystifies the installation, focusing on a UEFI setup compatible with most modern computers. Whether you’re an experienced user or a first-timer, this step-by-step tutorial ensures a smooth journey into the world of Arch Linux.


What Is Arch Linux and Why Install It?

Arch Linux is a rolling-release distribution offering cutting-edge software. With its lightweight and modular approach, Arch lets users create tailored systems. Despite its complexity, mastering its installation process teaches invaluable Linux fundamentals.


Preparing to Install Arch Linux

Before diving into the installation, ensure you have the following:

  • A computer with UEFI firmware
  • A bootable Arch Linux USB stick
  • Internet connectivity (preferably via Ethernet for simplicity)

Confirming UEFI Mode

To verify UEFI mode, boot the USB stick and check for the UEFI boot options, which are typically displayed prominently on the screen during the initial loading phase. If you see the Arch Linux menu, you’re in the right mode. Take a moment to examine the different options available, as they may include various kernel parameters and recovery tools that can be useful for troubleshooting. Select the first option by pressing enter or let it time-out automatically to boot automatically; this allows you to proceed to the installation process without further input. Ensure that your system is set to the correct boot sequence in the BIOS settings to avoid any issues and to facilitate a smooth installation experience.

Arch Linux UEFI Boot Option
Arch Linux UEFI Boot Option
Arch Linux ISO Boot Screen
Arch Linux ISO Boot Screen

Setting Keyboard Layout

Arch Linux defaults to the US keyboard layout, which may not be suitable for all users, especially those who prefer different regional settings. To change it, start by opening the terminal and using the localectl command to list your current keyboard settings, allowing you to identify the options available for your preferred layout. Next, apply the desired settings by executing the command that specifies your new keyboard layout, ensuring that your workspace is more comfortable and tailored to your needs. After making these adjustments, test your new settings to confirm that everything is functioning as intended and that your typing experience has improved:

  • For Italian: loadkeys it
  • To revert to US: loadkeys us
Arch Linux Keyboard Layout
Arch Linux Keyboard Layout

Connecting to the Internet

Using Ethernet

Plug in an Ethernet cable for seamless connectivity, ensuring that your device is properly connected to the local network. This direct connection will significantly enhance your internet speed and stability compared to a wireless setup, which can be prone to interference. Once the cable is securely plugged in, test the connection with the ping command in your terminal to check network connectivity. Additionally, you can also check for network status indicators on your device to confirm that the connection is active and functioning as expected.

ping archlinux.org
Arch Linux Internet Connectivity Test
Arch Linux Internet Connectivity Test

Using Wi-Fi

If Ethernet isn’t available, Arch includes iwctl for Wi-Fi setup. Although not covered here, consult the Arch Wiki for detailed instructions.


Partitioning Your Disk

Partitioning is crucial for organizing your drive, as it helps in managing data efficiently and enhances system performance. By creating separate sections for your operating system, applications, and personal files, you can optimize your workflow and simplify backup processes. Use the cfdisk tool for simplicity, which provides a user-friendly interface to create and modify partitions with ease; it allows you to visualize the drive’s layout, allocate space effectively, and make necessary adjustments without intense command-line expertise. Proper partitioning not only streamlines file management but also improves system security by isolating important data from less secure areas:

  1. Select GPT for UEFI systems.
  2. Create partitions:
    • Boot Partition: 100 MB (formatted as FAT32)
    • Swap Partition: 4-16 GB (depending on RAM)
    • Root Partition: Remaining space
Arch Linux CFDisk Label Type Selection (Not Applicable for all cases)
Arch Linux CFDisk Label Type Selection (Not Applicable for all cases)
CFDisk Partition Utility
CFDisk Partition Utility
CFDisk Disk Partitions
CFDisk Disk Partitions

Deleting Existing Partitions

When preparing to delete partitions if repurposing the disk for Arch, it’s important to carefully navigate through the options available in cfdisk. This tool allows you to manage your disk partitions intuitively, ensuring that you can free up space effectively without losing important data inadvertently. Begin by launching cfdisk from the terminal, where you will see a graphical representation of your partitions. Take your time to review each partition’s details and confirm that you no longer need the data stored on them. Once you identify which partitions to delete, proceed with caution, confirming each action as you go along, to systematically clear unwanted partitions while creating ample space for your Arch installation.

Disk Partitions Deleted
Disk Partitions Deleted

Formatting Partitions

Format partitions using the following commands: ensure that you have backed up all important data before proceeding, as formatting will erase all information on the partitions you choose to modify. Utilize disk management tools and carefully identify the partitions you want to format. Once you are certain, you can enter the appropriate commands in your terminal or command prompt to execute the formatting process smoothly. It’s crucial to double-check the file system type you want to use, such as NTFS for Windows or ext4 for Linux, ensuring that your selected format is compatible with your operating system and meets your specific requirements for storage and performance. In our case, we need to use the following commands:

  • Boot: mkfs.fat -F 32 /dev/sda1
  • Swap: mkswap /dev/sda2 && swapon /dev/sda2
  • Root: mkfs.ext4 /dev/sda3
Disk Partitions Written for Arch Linux Installation
Disk Partitions Written for Arch Linux Installation
Arch Linux Root Partition Formatting
Arch Linux Root Partition Formatting
Arch Linux Boot Partition Formatting
Arch Linux Boot Partition Formatting
Arch Linux Boot Partition Formatting
Arch Linux Boot Partition Formatting

Mounting Partitions

Mount partitions to their respective directories: to ensure that your system’s storage is organized and accessible, it is crucial to correctly mount each partition to its designated directory. This process not only simplifies file management but also enhances the performance of your system by allowing the operating system to locate and use resources efficiently. By carefully choosing the appropriate mount points, you can optimize your workflow, improve data retrieval times, and maintain a clear structure in your file hierarchy, which is essential for both users and applications alike.

mount /dev/sda3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
Arch Linux Mount Partition Mounting
Arch Linux Mount Partition Mounting
Arch Linux Boot Directory Creation
Arch Linux Boot Directory Creation
Arch Linux Mounting Boot Directory
Arch Linux Mounting Boot Directory

Activate swap:

swapon /dev/sda2
Arch Linux Activating Swap
Arch Linux Activating Swap
Arch Linux All Partitions Activated
Arch Linux All Partitions Activated

Installing Base System

Install essential packages with pacstrap: This command is an integral part of setting up an Arch Linux system and allows users to effortlessly install a base system along with necessary packages. By executing pacstrap /mnt base linux linux-firmware vim for example, you not only ensure that the core components are installed but also that tools for text editing are readily available for future configurations. The process streamlines the setup phase, minimizing the potential for errors while ensuring a clean, efficient installation conducive to a robust and customizable system. Use the following command in our case:

pacstrap /mnt base linux linux-firmware
Arch Linux Installing Base Packages
Arch Linux Installing Base Packages

Include additional packages like sudo, base-devel, networkmanager, and nano for a functional setup. These packages are essential for ensuring that the system can perform administrative tasks, compile software, manage network connections, and edit configuration files effectively. By incorporating sudo, you grant the necessary permissions to perform actions that require administrative rights, while base-devel provides a comprehensive suite of development tools essential for building applications. Furthermore, networkmanager simplifies the management of network settings, making it easier to connect to a variety of networks, and nano serves as a user-friendly text editor, allowing for straightforward modifications to system files and scripts, which is crucial for maintaining and personalizing the operating system.


Generating the File System Table

Generate the fstab file to define mount points:

genfstab -U /mnt > /mnt/etc/fstab
Arch Linux Generating File System Table
Arch Linux Generating File System Table

Verify with:

cat /mnt/etc/fstab
Arch Linux Verifying File System Table
Arch Linux Verifying File System Table

Entering the Installed System

Change root into the installed environment by using the appropriate commands that allow you to navigate into the system directory where your software is hosted. This process involves utilizing a terminal or command line interface, which serves as the gateway to executing the necessary commands. Once you access the terminal, you can employ commands such as cd followed by the path to the desired directory to ensure that you are operating within the correct environment, which is crucial for managing configurations and installations effectively. Always verify your current directory using commands like pwd to avoid any potential mishaps during this critical setup phase. Change root into the installed environment using the following command:

arch-chroot /mnt
Arch Linux Entering Installed System via Change Root
Arch Linux Entering Installed System via Change Root

Configuring System Settings

Setting Timezone

Link the appropriate timezone:

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc
Arch Linux Setting Time Zone
Arch Linux Setting Time Zone

Localization

Uncomment your locale in /etc/locale.gen (e.g., en_US.UTF-8) and generate it: this step is essential for proper localization of your system, ensuring that applications can correctly display text in your desired language format. After editing the file, you will need to run the command locale-gen to generate the specified locale settings, which will enable full support for localized content and formatting, enhancing your overall user experience. Additionally, remember to update your environment variables and check the active locales using the locale command to confirm that everything is set up correctly.

locale-gen  
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Local-gen in Arch Linux
Local-gen in Arch Linux
Locale Generated in Arch Linux
Locale Generated in Arch Linux
Saving Locale in locale.conf
Saving Locale in locale.conf

Hostname

To set a hostname, you need to identify the desired name that will represent your device on a network. This name is crucial as it helps in the identification and management of computers within a local area network or over the internet. It’s important to choose a name that is unique, easy to remember, and reflects the purpose of the machine, as this will not only ease navigation but also enhance communication with other devices. Additionally, once you set a new hostname, make sure to verify your changes and restart the system if necessary to ensure that the new settings take effect properly. Use the following command to set a hostname, “myarch”:

echo "myarch" > /etc/hostname
Arch Linux Hostname Setting
Arch Linux Hostname Setting

Update /etc/hosts for networking:

127.0.0.1 localhost
::1 localhost
127.0.1.1 myarch.localdomain myarch

Creating a User Account

Create a user and set permissions:

useradd -m -G wheel -s /bin/bash username
passwd username
Adding New User in Arch Linux and Setting Password
Adding New User in Arch Linux and Setting Password

Enable sudo for the user by editing the sudoers file:

EDITOR=nano visudo

Uncomment %wheel ALL=(ALL:ALL) ALL.

Running as Sudo with new user
Running as Sudo with new user
Wheel Group Sudo
Wheel Group Sudo

Installing a Bootloader

For UEFI systems, install GRUB: it serves as the bootloader that enables the operating system to load efficiently, providing critical functionalities for managing multiple operating systems or kernels. Once installed, GRUB not only helps in the booting of your Linux distribution but also allows for a customizable boot menu, making it easier to select between different installed operating systems or configurations at startup.

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
Grub Installation
Grub Installation

Enabling Network Services

Enable NetworkManager for internet access:

systemctl enable NetworkManager
Enabling NetworkManager Service
Enabling NetworkManager Service

Rebooting into Arch Linux

To successfully exit the chroot environment, it is essential to ensure that any changes made during the installation process are properly saved. After confirming that all tasks are complete, you should unmount the drives methodically to prevent any data corruption. This involves using the appropriate umount commands for each mounted partition or drive in the chroot directory. Once all drives have been successfully unmounted, you can confidently proceed to reboot the system, which will allow you to boot into your newly installed Arch Linux environment and begin utilizing the features and capabilities it offers.

exit
umount -R /mnt
reboot
Unmounting Drives and Rebooting
Unmounting Drives and Rebooting
Grub Boot Menu
Grub Boot Menu
Logging into Arch Linux
Logging into Arch Linux

Post-Installation: Setting Up KDE Plasma

To install a graphical desktop environment, specifically Plasma, you first need to ensure that your system is up to date and compatible with the latest software packages. This environment is known for its sleek design and customizable interface, which can significantly enhance your user experience. Begin by executing a package manager command to download the necessary Plasma packages and their dependencies. Once everything is set up, restart your system to log into your new Plasma desktop environment.

sudo pacman -S plasma sddm
Installing KDE Plasma with Default Options
Installing KDE Plasma with Default Options

Enable and start the display manager:

sudo systemctl enable --now sddm
Enabling and Starting KDE Plasma Sddm
Enabling and Starting KDE Plasma Sddm
Neofetch Showing Arch Linux Successfully Running
Neofetch Showing Arch Linux Successfully Running

FAQs

What is UEFI, and why is it required?

UEFI is modern firmware offering advanced features like faster boot times and secure boot, essential for Arch Linux installations on newer systems.

How can I install Arch Linux on a non-UEFI system?

Refer to the Arch Wiki for legacy BIOS setups.

Why use cfdisk instead of fdisk?

cfdisk offers a user-friendly interface, making partitioning simpler for newcomers.

What if I encounter boot issues?

Verify GRUB installation and UEFI settings in your firmware configuration.

Can I dual boot Arch Linux?

Yes, but configure partitions carefully and ensure GRUB detects other operating systems.

How do I install additional software after setup?

Use the pacman package manager:

sudo pacman -S package_name  

Conclusion

Installing Arch Linux provides a rewarding experience and unparalleled system control. While challenging at first, following this no-nonsense guide ensures a successful setup. With Arch Linux, you gain not just an operating system but an education in Linux’s inner workings.


Buy me A Coffee!

Support The CyberSec Guru’s Mission

🔐 Fuel the cybersecurity crusade by buying me a coffee! Your contribution powers free tutorials, hands-on labs, and security resources.

Why your support matters:
  • Writeup Access: Get complete writeup access within 12 hours
  • Zero paywalls: Keep the main content 100% free for learners worldwide

Perks for one-time supporters:
☕️ $5: Shoutout in Buy Me a Coffee
🛡️ $8: Fast-track Access to Live Webinars
💻 $10: Vote on future tutorial topics + exclusive AMA access

“Your coffee keeps the servers running and the knowledge flowing in our fight against cybercrime.”☕ Support My Work

Buy Me a Coffee Button

If you like this post, then please share it:

Tutorials

Discover more from The CyberSec Guru

Subscribe to get the latest posts sent to your email!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from The CyberSec Guru

Subscribe now to keep reading and get access to the full archive.

Continue reading