Installing Arch Linux Hard Way
Before Installation
- Backup your data
- Download Balena Etcher & ISO of ARCH Linux
- Burn ISO to a USB
- Restart
Boot
- Press DEL and load to BIOS mode
- Change Boot Priorities to USB
- Reboot
ARCH
Load ‘Arch Linux Install Medium’
Connect Your Arch to internet
iwctl --passphrase "$WIFIPASSWORD" station wlan0 connect $WIFINAMEping 8.8.8.8
- If you get bytes back you are connected
Check if you are on UEFI mode
efivar -lList your disks (Remember your diskname you want to install Arch to)
lsblk
for me its sdc
Split up Partition and Prepare your Drive
gdisk /dev/sdc
CHOOSE YOUR DRIVE CAREFULLY
1
2
3
4
`x` for 'expert'
`z` for 'Zap'
"Y" to WIPE DISK
"Y" again to Confirm
Verify partitions
lsblk
- notice there is no partition on your disk
Partitioning
1
cgdisk /dev/sdc
- Press any key to continue
We are using cgdisk because its easier, relatively.
- Separate ROOT and HOME Partition
Root Partition: Where all OS Files will be stored
Home Partition: Where all General Files will be Stored
BOOT Partition
- Use your keyboard and highlight “NEW” press “ENTER”
- First Sector: (Default): (leave Blank and press “ENTER”)
- Size in Sectors: 1024MiB
- 1 GB for Boot Drive
- Hex Code for GUID: ‘EF00’
- Name your Drive: ‘boot’
SWAP MEMORY
When you run out of RAM this memory is used. Make this regardless of your RAM Size
- Highlight and go to BIG size ‘free space’ (probably 3rd option)
- “NEW” again
- First Sector: (Default): (leave Blank and press “ENTER”)
- Size in Sectors: 16GiB
- 16 GB for SWAP Drive
- Hex Code for GUID: ‘8200’
- Name your Drive: ‘swap’
ROOT Partition
- Highlight and go to BIG size ‘free space’ (probably last option)
- “NEW” again
- First Sector: (Default): (leave Blank and press “ENTER”)
- Size in Sectors: 40GiB
- 40 GB for Root Drive
- Hex Code for GUID: ‘8300’
- Name your Drive: ‘root’
Home Partition
- Highlight and go to BIG size ‘free space’ (probably last option)
- “NEW” again
- First Sector: (Default): (leave Blank and press “ENTER”)
- Size in Sectors: (Default): (leave Blank and press “ENTER”)
- Hex Code for GUID: ‘8300’
- Name your Drive: ‘home’
FInishing Partitioning
- Use your arrows key to select “Write”
- Confirm with “yes”
- And arrows key to “Quit”
clear
Formatting Drives
lsblkto confirm drives againmkfs.fat -F32 /dev/sdc1File Allocation Table
mkswap /dev/sdc2To make swap format
swapon /dev/sdc2Enable Swap
mkfs.ext4 /dev/sdc3‘y’ to confirm if it asks
mkfs.ext4 /dev/sdc4Hint: press up arrow and change sdc3 to sdc4
Mounting the drives
mount /dev/sdc3 /mnt
mkdir /mnt/boot
mkdir /mnt/home
mount /dev/sdc1 /mnt/boot
mount /dev/sdc4 /mnt/home
Basically we are making folder and structuring it with proper drives and partitions we made earlier.
Update Mirrorlist
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
We are just Backing up incase we mess something up.
Rank Mirrors
This is to find Fastest mirror suitable to YOU.
If you find error install rankmirrors
sudo pacman -Sy pacman-contrib
Press Enter to confirm
rankmirrors -n 6 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
This will be working so system isn’t hang, Wait till it shows root@Archiso.
What it did was found best mirrors and copied it to your mirrorlist
cat /etc/pacman.d/mirrorlist
shows what we did earlier, so yeah ranked mirrorlist
INSTALLING NOW
pacstrap -K /mnt base linux linux-firmware base-devel
We are installing Base Linux.
genfstab -U -p /mnt >> /mnt/etc/fstab
setup all the drives and structure so hard drive is recognized while booting
Booting into Installation
arch-chroot /mnt
Install ‘nano’ and ‘bash-completion’
sudo pacman -S nano bash-completion
Enter to confirm
Enable Locales
nano /etc/locale.gen
- Find your locale (for me its en_AU.UTF-8 UTF-8)
- remove # from its front
- hit ‘ctrl o’ and press enter to save
- hit ‘ctrl x’ to close
locale-gen
echo LANG=en_AU.UTF-8 > /etc/locale.conf
export LANG=en_AU.UTF-8
TimeZone
ls /usr/share/zoneinfo/
From here select your country and press tab
It will list your Timezone
write few characters of your TZ and press Tab
Move to first part of your script and change, mine is Australia Sydney so i will be doing this:
ln -s /usr/share/zoneinfo/Australia/Sydney > /etc/localtime
hwclock --systohc --utc
We are syncing time with BIOS time so Your PC has right time every time you open it.
Hostname
echo archish > /etc/hostname
instead of ‘archish’ use whatever name you want
IF YOU HAVE SSD
systemctl enable fstrim.timer
- Enable 32 bits packages
nano /etc/pacman.conf
Go all the way down to [multilib] and remove # from both line
sudo pacman -Sy
SET USER AND PASSWORDS
set root password
passwd
Type password enter, it wont show it but its writing
Add User
useradd -m -g users -G wheel,storage,power -s /bin/bash ghost
instead of ghost write your own username
- give that user password
passwd ghost
Type password and enter.
Modify sudo file
EDITOR=nano visudo
Opens sudo file
Search for %wheel
use ‘ctrl w’
find ‘%wheel ALL=(ALL:ALL)ALL’
Uncomment it (remove # from front)
BootLoader
mount -t efivarfs efivarfs /sys/firmware/efi/efivars/
Install bootloader
bootctl installWrite entries for boot loader
nano /boot/loader/entries/arch.conf
Write the 3 lines
1
2
3
title ARCH
linux /vmlinuz-linux
initrd /initramfs-linux.img
save and exit (ctrl o and ctrl x)
Point to your harddrive
echo "options root=PARTUUID=$(blkid -s PARTUUID -o value /dev/sdc3) rw" >> /boot/loader/entries/arch.conf
This hardcode your UID of partition to your bootloader
ip link
Know your network
enable ‘dhcpcd’
sudo pacman -S dhcpcd
sudo sydtemctl enable [email protected]
install NetworkManager
sudo pacman -S networkmanager
sudo systemctl enable NetworkManager.service
install linux headers
sudo pacman -S linux-headers
Follow ONLY IF YOU HAVE GPU
NVIDIA
sudo pacman -S nvidia-dkms libglvnd nvidia-utils opencl-nvidia lib32-libglvnd lib32-nvidia-utils lib32-opencl-nvidia nvidia-settings
sudo nano /etc/mkinitcpio.conf
Inside MODULE=() add these in exact order, it should look like this
MODULES=(nvidia nvidia_modeset nvidia_uvm nvidia_drm)make sure they are loaded during boot time
sudo nano /boot/loader/entries/arch.confright after options line, after rw, in same line
nvidia-drm.modeset=1Hook for pacman to update nvidia driver
sudo mkdir /etc/pacman.d/hookssudo nano /etc/pacman.d/hooks/nvidia.hookAdd
1 2 3 4 5 6 7 8 9 10 11
[Trigger] Operation=Install Operation=Upgrade Operation=Remove Type=Package Target=nvidia [Action] Depends=mkinitcpio When=PostTransaction Exec=/usr/bin/mkinitcpio -P
Else, Continue…
exit
umount -R /mnt
reboot
You can plug out the USB
When the system boots up, use your credentials to login.
Internet
If you cannot connect to internet
nmtui
Activate a Connection and Connect
Install x11 for KDE
sudo pacman -S xorg-server xorg-apps xorg-xinit xorg-tvm xorg-xclock xterm
- to test
startx
if clocks shows up its installed, click any terminal u see and
exit
Install Plasma or Any Desktop Environment you want
sudo pacman -S plasma sddm
- enter password
- just keep entering Enter
Enable SDDM
sudo systemctl sddm.service
REBOOT
This is straight method to install arch linux “hard way”. If you get any error or prefer different way, consult Arch Wiki Installation Guide.
