Step-by-step guide for installing archlinux
on a local
machine/VirtualBox
Partitions
Disk information
lsblk
listing all the disks
fdisk -l
Select the disk where you want to install archlinux
fdisk /dev/sda
Make a gpt partition
EFI partition: 500MB # dev/sda1
Swap partition: Double of available ram # dev/sda2
Root partition: Available free space # dev/sda3
Formating
Format EFI
directory
mkfs.fat -F32 /dev/sda1
Create swap
mkswap /dev/sda2
Finally, format root directory
mkfs.ext4 /dev/sda3
Mount drive
Mounting and activating partition
We need to mount the esp where bootloader will be installed. We can
directly mount esp to /mnt/efi and don’t need to mount it in
/mnt/boot/efi. Since there is no /mnt/efi
directory by default so we will create and mount that the esp
Base installation
Fstab
We must write mounting drive information at /mnt/etc/fstab
location to mount the drive automatically while booting the machine.
Now change the root path for further installion of the base system
Basic packages cab be installed by pacman
Enable services
Enable essential services at boot time
NetworkManager
Printing system
Refresh mirrorlist
This section is optional
and can be headed into next section.
The performance of the mirrorlist varies over time and mostly depends on how far the geographic location of the server from your local machine location.
reflector
is a tool which sort out the latest servers from the basis of
performance and geographic location. Install additional necessary packages
It is better practise to first create a backup file of the mirrorlist. If something goes wrong with your mirrolist updatation process then you can revert to the previous version.
Sorting the mirrorllist of best 5 server of India
Configure
Timezone
Link your zone time with your local time
Syncing it with Hardware clock
Locale
Edit /etc/locale.gen
and uncomment en_US.UTF-8 UTF-8
,and then generate
locale by
Also create the locale.conf
file, and set your LANG variable
# FILE nano /etc/locale.conf
LANG=en_US.UTF-8
Hostname
Choose your hostname that you prefer
# FILE nano /etc/hostname
Hosts
Add matching entries to hosts
FILE nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch.localdomain arch
Ramdisk
Create Ramdisk for the booting process
User creation
First set the password for the root
user
Add a user with sudo permission, Here the user is added in wheel
group
Install sudo
package
Edit the visudo
file to give the permission to wheel group
FILE EDITOR=nano visudo
# uncomment the line
%wheel ALL=(ALL) ALL
Bootloader
Here I have chosengrub
as bootloader and for theat this twp packages grub
and efibootmgr
are required.
Below two commands are GRUB
specific
Micro-code
cpu micro-code must be loaded by the bootloader, for intel cpu users
for amd cpu pacman -S mesa amd-ucode
DE
First install graphics driver packages
for amd gpu pacman -S mesa xf86-video-amdgpu
NB virtualbox only
pacman -S xf86-video-vmware virtualbox-guest-utils
Install xorg
display server and also install packages for wayland
support
Display manager for the plasma desktop is sddm
pacman -S sddm
For gnome user, install gdm
display manager
pacman -S gdm
Enable the system display manager
systemctl enable sddm.service
for starting gdm
service, systemctl enable gdm.service
Install Plasma Desktop environment and kde applications for the most use cases,
pacman -S plasma kde-applications
for Gnome pacman -S gnome gnome-extra gnome-tweaks
Reboot
exit
umount -R /mnt
reboot
Congratulations you have installed archlinux
with your favorite
desktop environment. Add a tag on your profile btw I use arch
:)