Skip to content

arch linux installation for noobs

freeezer98 edited this page Oct 8, 2018 · 1 revision

ARCH LINUX INSTALLATION GUIDE FOR NOOBS

Welcome to Arch-Linux install guide for noobs like me. Who take hard-time reading arch-wiki, which is a god among wiki's.

Note: This Guide is simplified from ArchWiki installation guide, and a bit from here, here


ARCH LINUX

Getting Arch: Pre-Install (check this out once)

Firstly, Download Arch Linux form here, then burn the ISO file into a disk or Pen-drive(using rufus in windows or etcher for linux etc), then boot into the installtion media, which automatically logins as root.

UEFI

This guide assumes that you are using uefi mode enabled.

To check if UEFI is enabled (if the following file is populated, then yes)

ls /sys/firmware/efi/efivars

Network Check

To ensure internet is working, If the following works skip next step.

ping google.com

Wireless configuration:

To find network card name (note: lo is loop device) lspci -v or ip link

To shows available networks

wifi-menu -o (network card name)

To check if loaded

dmesg | grep (network card name)

To show network up down status

ip link show dev (network card name)

To manually configure static IP

sudo cp /etc/netctl/examples/ethernet-static /etc/netctl/(network card name)
sudo nano /etc/netctl/(network card name)

change interface to your network card name and save the file.

sudo netctl enable (network card name)
sudo netctl start (network card name)
sudo systemctl stop dhcpcd
sudo systemctl disable dhcpcd

To verify network is up or down

ip addr

For more Network Configuration

Time Date

timedatectl set-ntp true
timedatectl status

Partitioning

To identify the device where the system will be installed lsblk

x is your device, usually x=a.

fdisk -l
fdisk /dev/sdx

For uefi we need a fat32 esp partition (For windows pre-installed this partition is already created by windows and is usually about 500mb. Do not create new partition if this is available or else make one)

Note: Do not format this partition as you may loose windows boot loader More Dual Boot

Basic Partitioning:

 /dev/sda1  This is root partition around 10gb, ext4
 /dev/sda2  This is swap partition around 2*RAM size(usually for less ram devices below 8)
 /dev/sda3  This is ESP partition around 500mb, FAT32 (skip this for dual boot as mentioned above)
 /dev/sda5  This is home partition rest of space, ext4

To list all partitions, Open fdisk dialogue

 fdisk -l /dev/sda
 fdisk /dev/sda

In fdisk dialogue use n to create new partitions, first initial block can be default, end point can be given +10G(+[size][K,G,etc]). after creating required parts w to save and exit

For More Partitioning

Formatting

Should format all partitions except swap

To list all partitions

lsblk /dev/sda

Formatting boot partition (do not format esp if not created by you i.e if using already available esp).

 mkfs.fat -F32 /dev/sda3

Setup swap space

 mkswap /dev/sda2
 swapon /dev/sda2

Formatting Root and Home partitions

 mkfs.ext4 /dev/sda1
 mkfs.ext4 /dev/sda5

check again using lsblk to verify

Mounting

Mounting Root Partition

 mount /dev/sda1 /mnt

Mounting Boot Part(here y is your esp partition number, In this guide it is sda3)

 mkdir /mnt/boot
 mount /dev/sday /mnt/boot 

Mounting Home partition

 mkdir /mnt/home
 mount /dev/sda5 /mnt/home

Installation

Pacstrap:

Installing arch linux base system

 pacstarp /mnt base base-devel

Fstab:

Generating fstab file

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

To verify fstab entries

cat /mnt/etc/fstab

Chroot:

changing root into new system

arch-chroot /mnt

Time zone:

Check your time zone using ls /usr/share/zoneinfo/ and setup using:

ln -s /usr/share/zoneinfo/(Region)/(city) /etc/localtime

Adjusting time skew and setting to utc

hwclock --systohc --utc

Locale:

In the following file uncomment en_US.UTF-8 UTF-8 in the file and save and quit.

nano /etc/loacle.gen

To create new location

locale-gen

Set system locale

echo LANG=en_US.UTF-8 > /etc/locale.conf

Network configuration

Add a hostname (Feel free to change hostid in the following command)

echo hostid > /etc/hostname

Deprecated method:

To find your interface or network card name

ip link

enabling dhcpcd service for wired connections where nwname is interface name from above command

systemctl enable dhcpcd@nwname.service

Install the following for wireless connections

pacman -S iw wpa_supplicant dialog

(check out wireless management arch wiki)

Modern method:

pacman -S networkmanager
systemctl enable NetworkManager.service
nmtui-connect

More Wireless Management

Initramfs and password

Initramfs:

mkinitcpio -p linux

Password:

passwd

Boot Loaders

For amd install amd-ucode, For intel install intel-ucode package

Available Boot Loaders

In this Guide we are using grub (widely used)

First install grub and efibootmgr

pacman -S grub efibootmgr

To install grub (ESP is the 500mb partition we created, at esp type where you mounted, here in this guide it is /boot)

grub-install --target=x86_64-efi --efi-directory=esp --bootloader-id=GRUB

To regenerate the grub main config

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

If windows is pre-installed then add the following to grub to make windows boot option visible: add this

More Grub

Exit and Reboot

To exit from chroot exit or ctrl + D

To manually unmount all partitions

umount -R /mnt

To restart the machine reboot

Arch Linux Installation is complete.

Post Installation

Login as root

To update system pacman -Syu

User Managerment:

Root is dangerous to play with, It is always recommend to use a user.

To install sudo pacman -S sudo

To add a user account and give a password, where uname is your username (wheel is a group name)

useradd -m -G wheel uname
passwd uname

To give sudo access, run visudo and uncomment the required line (mostly %wheel ALL =(ALL) ALL)

export EDITOR=nano && visudo

Logout and Login as user

Install Basic Packages:

sudo pacman -S gcc make wget tar tmux 

I recommend reading these:
systemctl usage, system maintenance, security.

Finally, Install a aur helper.

GUI

Display Servers:

Xorg: old stable, Wayland: new (not so stable)

Here we are using Xorg (also known as X), Install xorg-server xorg-apps xorg-server-utils

sudo pacman -S xorg-sever xorg-apps xorg-server-utils

Driver Installation:

To identify driver card

lspci | grep -e VGA -e 3D

Install appropriate driver from the list

pacman -Ss xf86-video

More Xorg

Install required display drivers

Install Desktop Environment or Window Manager of choice. DE's, WM's

Most Used:

DE's: GNOME, KDE, LXDE, XFce.

WM's: i3, openbox, fluxbox, awesomebox, bspwm, dwm.

Install Display Manager:

Starts GUI automatically, Select a Display manager

Enable required display manager service using systemd

systemctl enable lightdm.service

Use a custom greeter to login using credentials: LightDm Greeters

More:

Install most-essential applications from here

Install required applications from here