Arch Linux installation
Connect to the Internet
ping www.google.com to confirm working internet connection.
In most cases, it should work out of the box. If it doesn't work, run
dhcpcd and wait about 15-30 seconds and internet should be working.
lsblk -f to see the information about your detected hard drives and their partitions.
Destroy all partitions
This completely destroys all data on your
# sgdisk --zap-all /dev/nvme0n1
Create 2 partition on your hard drive - one is for EFI installation, second is for Arch Linux installation. Type command
cgdisk /dev/nvme0n1 to enter interactive CLI menu.
First, delete all the partitions (if any).
Then create new partition, first sector is default size suggested (just press enter), but for last sector, write +500M and hit enter. Partition code is ef00 and give any partition title you want (I suggest EFI).
Then create new partition, first and last sector is default size suggested (just press enter). Partition code is also default (should be 8300) and give any partition title you want (I suggest ROOT).
At the end - write and quit. Use
lsblk -f to confirm your new partitions - first should be the size of approximately 500Mb and the other partition should be the rest of your hard drive size.
The new created partitions cannot be used until you format them.
Format the first EFI partition (the one that has about 500Mb space):
# mkfs.fat -F32 /dev/nvme0n1p1
Then format second partition (the one that has the rest of hard drive space):
# mkfs.btrfs /dev/nvme0n1p2
Mount your prepared partitions so you can write some data (files) to them:
First, mount the second partition (the one that has the rest of your hard drive size) to /mnt directory :
# mount -o compress=zstd /dev/nvme0n1p2 /mnt
Then mount EFI partition to that
boot folder (it will create /mnt/boot dir automatically):
# mount --mkdir /dev/nvme0n1p1 /mnt/boot
lsblk -f to confirm if you successfully mounted your partitions.
Install base Arch Linux system
Automatically update mirrorslist:
# systemctl restart reflector.service
Perform this command to install base Arch Linux installation to mounted
# pacstrap /mnt base base-devel linux linux-firmware
Fstab file contains what and how must be mounted during the boot. The good thing that there is an app to generate fstab file automatically for you:
# genfstab -U /mnt >> /mnt/etc/fstab
You might also want to check if there is at least 2 lines containing information about partitions and their options:
# cat /mnt/etc/fstab
Enter the chroot mode
If you don't know what is chroot - think about logging into the installed system (AKA directory, where it is installed) with a root user, but without password. Everything you do in chroot mode will be permanent (will not be lost after reboot) and this procedure is usually used to fix existing systems when they no longer boots.
Enter Chroot mode with this command:
# arch-chroot /mnt
Set up locale
Set the US locale to your system.
#en_US.UTF-8 UTF-8 to
# nano /etc/locale.gen
Then apply changes to the system:
/etc/locale.conf file. This is needed for most of the programs:
# echo LANG=en_US.UTF-8 > /etc/locale.conf
Set up timezone
Create symbolic link as per below command. Ensure you replace Zone and SubZone accordingly:
# ln -sf /usr/share/zoneinfo/Zone/SubZone /etc/localtime
ln -sf /usr/share/zoneinfo/Europe/Vilnius /etc/localtime
Set the hardware clock
Execute this command:
# hwclock --systohc
Set up datetime synchronisation
systemd-timesyncd.service so it starts on boot, synchronizes with NTP (time) servers and sets correct datetime:
# systemctl enable systemd-timesyncd.service
Set the hostname
Just give a name to your computer (without space). Example would be
# echo ARCHLINUX > /etc/hostname
Set the password
passwd root to change root user password.
We will be using the most popular bootloader GRUB.
Install required packages for grub installation & configuration:
# pacman -S grub efibootmgr
Then install GRUB as a bootloader:
# grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-installsays that errors occurred, then your system will not boot.
Then (re)generate GRUB config file:
# grub-mkconfig -o /boot/grub/grub.cfg
Install other required packages
networkmanagerpackage and forget below packages.
NetworkManager pulls all the required dependencies, so installing just that is enough:
# pacman -S networkmanager # systemctl enable NetworkManager.service
You might also want to install Microcode updates to your system:
# pacman -S intel-ucode # For Intel processors only # pacman -S amd-ucode # For AMD processors only
And do not forget to update grub configuration afterwards:
# grub-mkconfig -o /boot/grub/grub.cfg
First create new user with its home directory:
# useradd --create-home name
Then set user password:
# passwd name
Allow user to gain root access
nano editor edit sudoers file:
# EDITOR=nano visudo
And uncomment line
# %wheel ALL=(ALL) ALL by changing to
%wheel ALL=(ALL) ALL. Save the changes.
Then add your regular user to
# gpasswd -a name wheel
sudocommand, then uncomment
# %wheel ALL=(ALL) NOPASSWD: ALLinstead.
Install desktop environment
Below command installs all the required packages for proper Plasma experience, including login manager, bluetooth, audio and xorg packages:
# pacman -S plasma dolphin konsole
sddm on boot:
# systemctl enable sddm.service
Other important steps
You have to options
- Install Firefox via Flatpak.
- Install Firefox via
pacman -S firefox
Enable Bluetooth support
Execute below command:
# systemctl enable bluetooth.service
Arch Linux on laptop
If you are installing Arch Linux on laptop (mobile) device, install
tlp as it optimises power usage on laptops:
# pacman -S tlp # systemctl enable tlp
Install AUR helper
You can install packages from the official repositories as well as AUR using single package manager called
yay. See here.
Exit the chroot mode:
# umount /mnt/boot # umount /mnt
And GRUB menu should show up when computer starts to boot.
I suggest reading these Arch Wiki pages to get familiar with Arch Linux and Arch Wiki:
- Add Chaotir-AUR repository that has the most popular AUR packages precompiled. See here.
- Find your hardware specific pages (e.g. ASUS_Zenbook_UX430/UX530 or ASUS_N550JV).
- Fan_speed_control - if you want to control fan speed. Also works on majority of laptops.
- Undervolting_CPU - Reduce heat and save power. Especially useful for laptop users.
- Improving_performance - Title says it all.
- Btrfs - Modern file system (EXT4 replacement), which has optimisations for SSD and other useful features.
- List_of_applications - Arch wiki have these kind of pages as well.
- And many more, depending on your needs...
xfce-theme-manager arc-gtk-theme arc-icon-theme, then open XFCE Theme Manager GUI app and change the theme as well as icons. :) Reboot the system if some elements were not affected by theme.
How to fix completely broken system
This is just a guidance on where to start looking for issues if they cannot be fixed from the same system (e.g. system not booting up).
First, boot up Arch Linux from USB stick (live mode).
Then connect to internet (if you need it) as per instructions in User:Erkexzcx#Internet_connectivity.
lsblk -f detect which partition is Arch Linux installation and which is EFI installation. EFI should be the size of about 500Mb. Let's assume
dev/sda1 is EFI partition and
dev/sda2 is linux installation:
# mount /dev/nvme0n1p2 /mnt # Mount /dev/nvme0n1p2 on /mnt directory # mount /dev/nvme0n1p1 /mnt/boot # Mount /dev/nvme0n1p1 on /mnt/boot directory # arch-chroot /mnt # Chroot to /mnt directory (our system is mounted to it)
Lightdm is not starting or not allowing to login or access terminal.
Chroot to system, then it is likely a good idea to disable Lightdm (no longer start on boot):
# systemctl disable lightdm.service
Then reboot your system:
# exit # reboot
Forgot user (or root user) password.
Chroot to system, then:
# passwd user
Then reboot your system:
# exit # reboot