Windows & Other OS

How to install Arch Linux on a PC

Rupesh Pathak /

Arch Linux It is known for its complex command-based installation. But once you get familiar with the ins and outs of the process, you can install Arch on any computer without fear of terminal . We will help you get there.

Note: Arch Linux ISO includes a script called archinstall intended to help you through the process. However, as of this writing, the script is still experimental and error prone in our tests. Instead, this guide will cover the standard installation method.

Download Arch Linux ISO

The first step is to get the Arch Linux installation image from a suitable mirror. To do so, visit the page of Arch Linux download and depending on how you want to download the ISO, select the appropriate option. Available options include direct download, torrent , picture of virtual machine , “Netboot” installation for wired connections and more.

arch linux direct downloads page

To keep it simple, we will do a direct download. Scroll down to the list of available mirrors and choose one. Selecting a server closer to your geographic location will ensure that you get a fast and stable download speed. Verify the ISO checksums to confirm that the downloaded file is genuine and safe.

The next steps include create a bootable USB drive , restart your computer and boot from the newly created installation media in instead of the hard drive. The Arch Linux boot interface will load and you will be prompted to choose from the various options displayed.

Select the default highlighted option by pressing “Enter.” After the system has successfully loaded the files required for installation, you will see the message “root @ archiso”.

Preliminary steps

Moving on, you must have an active internet connection for the installation to complete. The Arch installer indicates that connections Ethernet and DHCP they should work automatically. However, users of a wireless network will need to configure a connection manually.

Just to be safe, check if you are connected to a network by typing ping If the result looks like this, you can go to the next section .

check network in Arch Linux with ping

However, if you get the error “Temporary name resolution failure”, you must establish an Internet connection using the iwctl command.

First, start the utility interactively by typing iwctlIn the terminal. Then verify the name of your wireless interface by issuing the device listcommand. Generally, the name of the wireless interface will start with a “w”, such as wlan0 or wlp2s0.

Then run the following commands to find your SSID and connect to it. Replace [device]and [SSID]in the commands with your wireless interface and Wi-Fi name respectively.

estación iwctl [dispositivo] get-networks
estación iwctl [dispositivo] conectar [SSID]

The system will ask you for the Wi-Fi password if you have one configured. Write it down and press “Enter” to continue. Run from ping google.comagain to verify the connection.

Enable network time synchronization using timedatectl by running the following command:

timedatectl set-ntp true

Install Arch Linux system

With your PC connected to the Internet, you are ready to go. The process of installing Arch in its kernel is similar to the one installation of any other Linux distribution . So what’s the catch?

While other distributions provide a graphical user interface to configure and configure the operating system, Arch Linux comes with only one command line interface . Any instruction, command or configuration must be done through the shell.

Creating the necessary partitions

To install Arch, you will need to create three partitions, namely , EFI , root and swap . List the storage devices available on your system using fdisk -l. Most of the time the HDD would be listed as /dev/sdaand the SSDs would be listed as /dev/nvme0n1.

Runfdisk writing fdisk /dev/sdaor fdisk /dev/nvme0n1, depending on whether you are installing the operating system on an HDD or SSD. Then write gand hit “Enter” to create a new GPT partition table.

Scribe nto create a new EFI partition and choose the partition type primary. Press “Enter” twice to continue with the default partition number and the value of the first sector.

For him size of the partition , you can enter the sector number manually or specify the size you want the partition to be. Since you don’t want to waste disk space on EFI partitions, any number between 500M and 1G would work. Writes +550Mand press “Enter” to continue.

Can replace 550Mthe command mentioned above with the size you want for the partition.

create partitions with fdisk

In the same way, create a swap partition with +2Gthe last value of the sector. Finally, create a root partition and assign all the remaining sectors to it just continuing with the default settings.

By default, all partitions will have the type “Linux File System”. To change this, type tand press “Enter” to continue. Select the EFI partition by entering 1. Then write efto change the file system to the EFI system type.

Similarly, select the swap partition (partition number 2) and type 82to convert partition type to Linux swap. The root partition must be of the Linux filesystem type, so there is no need to change it.

Writes wand press “Enter” to write the changes to disk.

Format the partitions

Now you need to format the partitions using the mkfscommand . Format the /dev/sda1partition (EFI) to FAT32 writing:

mkfs.fat -F32 / dev / sda1

Again, run the following command to format the /dev/sda3partition (root) to ext4:

mkfs.ext4 / dev / sda3

Issue the following commands one by one to format and enable the swap partition:

mkswap / dev / sda2
swapon / dev / sda2

Warning: For those who have a Linux dual boot with Windows Make sure you have the correct partitions configured. Pay special attention when you are formatting partitions or creating new ones, as a mistake here can render your Windows system unusable.

System installation and configuration

In order to install Arch on your disk, you need to mount the created partitions in the appropriate directories. Mount the root partition ( /dev/sda3) at /mntdirectory.

montar / dev / sda3 / mnt

The next step is to install the basic Linux packages on the mounted root partition.

pacstrap / mnt base linux linux-firmware

This will take some time depending on your network connection. Once done, generate a file system table using the genfstabcommand.

genfstab -U / mnt >> / mnt / etc / fstab

The Arch Linux system is running on the /mntdirectory. You can change the root to access the system by typing:

arch-chroot / mnt

The change in the bash prompt indicates that you are now logged into the newly installed Arch Linux system. Before you can continue, you will need to configure some settings and install the necessary packages for the system to function properly.

Set the local time zone by creating a symbolic link between the directories “/ usr / share / zoneinfo” and “/ etc / localtime”.

ln -sf / usr / share / zoneinfo / Región / Ciudad / etc / localtime

Replace the “Region” and “City” in the above command with the appropriate time zone. You can check this base from time zone data to check the region and city you need to enter.

Then synchronize the hardware clock with the system time by running:

hwclock --systohc

Before proceeding, install Vim (or another text editor of your choice) and the “networkmanager” package.

pacman -S vim networkmanager

Then edit the file “/etc/locale.gen” with your text editor and uncomment the locale declaration to suit your needs. For the purpose of this guide, we will uncomment the en_US.UTF-8 UTF-8line in the file using Vim.

vim /etc/locale.gen

After editing the file, type locale-genin the terminal to generate the local configuration.

Then create a new hostname file inside /etcand add the hostname you want for your computer in the file. It can be anything you want and you don’t need to enter anything other than the name. When you’re done, don’t forget to save the file.

vim / etc / nombre de host

Create another text file with the name hostsunder the /etcdirectory.

vim / etc / hosts

You will notice that the file already contains some comments. Leave the comments as is and add the following text to the file. Remember to replace hostnamethe command with the system hostname you set in the previous step. localhost
:: 1 localhost hostname.localdomain nombre de host

Create and configure users

Set the password for the root user by typing the passwdcommand. Then create an additional non-root user using useraddthe following, replacing username with your username:

useradd -m nombre de usuario

Set the password for the new user using the passwdcommand, replacing it again usernamewith your username.

nombre de usuario passwd

Add the new user to groups wheel , audioand videousing the command given below. Replace it usernamewith your username and note that group names in the command do not have spaces after commas.

usermod -aG rueda, video, nombre de usuario de audio

GRUB bootloader configuration

First, install the grubpackage using pacman.

pacman -S grub

Then install these additional packages necessary for the bootloader to work properly.

pacman -S efibootmgr dosfstools os-prober mtools

Mount your EFI partition ( /dev/sda1) at /boot/EFIdirectory. Note that you will first need to create the directory with mkdir.

mkdir / boot / EFI
montar / dev / sda1 / boot / EFI

Finally, run the grub-installscript to install the boot loader in the EFI directory.

grub-install --target = x86_64-efi --efi-directory = / boot / EFI --bootloader-id = grub

Generate a GRUB configuration file of the grub-mkconfigFollowing way:

grub-mkconfig -o /boot/grub/grub.cfg

Install a desktop environment on Arch

Unlike other Linux distributions, Arch Linux does not ship with a desktop environment pre-installed . And if you want to control the system through a GUI, you will have to install one manually.

You can install the DE of your choice, but we will install the desk KDE Plasma in this system. However, before that, let’s configure the display server, network manager and similar services.

Run the following command to install the xorg, plasma-metaand kde-applicationspackages:

pacman -S xorg plasma-meta kde-aplicaciones

Then enable the SDDM and NetworkManager services by typing:

systemctl habilitar sddm
systemctl habilitar NetworkManager

Exit the arch-chroot environment by typing exit. Then unmount the root partition mounted on the /mntdirectory as follows:

umount -f / mnt

Finally, reboot your system writing reboot and remove the installation media. Once the system boots, you will notice that the dark terminal screen is now replaced with the colorful SDDM splash screen.

arch linux login screen after reboot

To log in, type the user password and press “Enter.” also can install multiple desktop environments and toggle between each using the “Session” drop-down menu on the home screen.

RELATED:   How to create a chart template in Microsoft Excel

Related posts

Leave a Comment