Thứ Hai, Tháng Hai 10, 2025
spot_img
HomeTechnologyBasic instructions for installing Arch Linux

Basic instructions for installing Arch Linux

Unlike Ubuntu or Linux Mint, Arch Linux is a rolling release Linux distribution. This means you only need to install it once and continuously receive updates to the latest version. It is also a barebone distribution allowing complete control over what you want to install on your system.

This article will guide you through the basic installation steps of Arch Linux. One thing to note is that the Arch Linux installation process is a bit complicated, you need to carefully follow the instructions below.

Before installing Arch Linux, you need to download the ISO file and burn it to a USB drive or DVD.

Step 1. Visit the Arch Linux download page at the address below and download the ISO file (in the HTTP Direct Downloads section).

https://www.archlinux.org/download/

Step 2. Using a bootable USB creation software, create a bootable USB.

Step 3. After creating the bootable USB, plug it into the computer and start it.

Note: To install Arch Linux, you should use a wired network because wireless connections require more configuration that is not covered in this guide.

Initial setup

Select boot into Arch in the initial boot menu, usually the first option. You will be taken to the Command prompt to log in as root.

Select Boot Arch Linux

To start, make sure the clock shows the right time with the following command:

timedatectl set-ntp true

Hard drive configuration

It's time to set up your hard drive. There are a few ways to configure a hard drive, but using cfdisk is the simplest.

cfdisk

If your hard drive doesn't already have a partition table, you will be asked to set one up. Choose DOS although this is not the newest option but is easier to work with.

Xem thêm  Instructions to turn off Messenger notifications without being disturbed

Partition hard drive

Next, you will see the hard drive partition table or free space listed. If your hard drive is already partitioned, you can skip this step and go to the next step. If you want to repartition, select them and choose Delete at the bottom of the screen.

Select the free space you want to create a partition, then select New at the bottom of the screen, tap Enter. Then enter the partition size you want to use. Repeat these steps for each partition. If you are not sure about the partition size, you can create a 512MB partition for it /boot and use the remaining space of the drive for root (/).

Once done, select Write from the bottom menu. Enter yes to confirm changes. Click q to escape.

Partition table

Create file systems for your new partitions. Actually, this part is very easy, you just need to run the following commands, assuming your drive is “/dev/sda.”.

mkfs.ext4 /dev/sda1
mkfs.ext4 /dev/sda2

Mount partition

Now, you are ready to mount the partitions and start setting up the system. Assuming your drives are “/dev/sda1” and “/dev/sda2, the setup will look like this:

mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot

Basic system setup

You can edit the CD mirror list here to select the most recently downloaded mirrors. This operation is not really necessary and can be time consuming. If you want to do this, put the mirrors closest to you at the top of the list “/etc/pacman.d/mirrorlist.

Basic system setup

Use the pacstrap utility to boot your system on the newly mounted drive.

pacstrap /mnt base

This process will take some time, you don't need to worry because Arch will basically set it up for you. Once the process is complete, you can create Arch's fstab file. This file will track file systems (partitions) to mount on the system.

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

Set up within the new system

Set up within the new system

It's time to migrate to the new Arch system by changing root (chroot) to the system. Chroot is a way to “piggyback” a Linux system onto another running system. Arch has a tool to perform this process.

arch-chroot /mnt

As soon as pressed Enterthe command prompt will change to reflect your new location in the Arch installation.

Xem thêm  How to fix GPU usage spike to 100% on Windows

Set time zone

Time zone settings

Next, you need to set the system time zone. You need to look at “/usr/share/zoneinfo” to determine your region and city, then associate it with your system's local time.

ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime

Synchronize your system with the hardware clock.

hwclock --systohc

Set up language

You will need to set up the language and everything else related to it correctly. Open /etc/locale.gen and uncomment (by removing the # in front of the line) the locale you choose.

Run the following command to create your location

locale-gen

Create a file at /etc/locale.conf and place your chosen location in this file as shown in the example below.

LANG=en_US.UTF-8

Network setup

Next we will configure the basic network. You will first set the computer's hostname in /etc/hostname.

yourhostname

Set hostname

Add the hostname to the “/etc/hosts” file so your computer can associate with itself.

127.0.0.1 localhost
::1 localhost
127.0.0.1 yourhostname

Finally, to have network connectivity on boot, enable the DHCP service on boot.

systemctl enable dhcpcd

Set up user accounts

Up until now, you are working as root user. For security, change the root user password by running the passwd command and entering the new password.

passwd

Change root user password

Next, you need to create a user account for daily use.

useradd -m -G users,audio,input,optical,storage,video -s /bin/bash username

Providing a new password works as for the root user but requires specifying the username in the passwd command.

passwd username

System task

System task

You will need to create an initramf (command input line) for your system to handle some common tasks like LVM, disk encryption, and RAID.

mkinitcpio -p linux

Before rebooting, install the bootloader, GRUB with Pacman.

pacman -S grub

Install GRUB on your hard drive so it can boot before Arch.

grub-install --target=i386-pc /dev/sda

Finally, set up GRUB's configuration on the “/boot” partition.

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

Once done, tap in exit. exit to get rid of chroot. Unmount your partitions and reboot into Arch.

exit
umount -R /mnt
reboot

Wishing you success!

Xem thêm  Latest Thien Nhai Minh Nguyet Dao code and how to enter the code
RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments