(Works with Arch ISO Image build as of: 2024.01.*)
Hello everyone, This is my guide for installing Arch Linux with KDE Plasma. In this guide, we will go step by step on how to do so.
- Let's Begin
- Connect to the Internet
- Disk Partitioning
- Base System Installation
- Chroot
- Boot Freshly Installed System
- User Login
- The Conclusion
- Extras (optional)
- Theming & Customisations
- Maintenance, Performance Tuning & Monitoring
- Changelog
- Grab the latest built ISO Image from Arch Linux Download and write it to an empty USB Stick.
- After the image is done writing, restart your computer and hold one of the following keys: Del, F12, F9, F7, Option
- Your computer will then prompt you to select a bootable device
- Select the bootable USB stick and your computer should show a range of options
- Select "Arch Linux Install medium" and wait to be booted into the ArchISO
If your computer doesn't recognise the USB stick or throws an error when trying to boot into it, you likely has Secure Boot on.
Go into your BIOS settings and disable Secure Boot.
Tip: Hit CTRL+L to quickly clear the screen
Firstly, use the command:
iwctl
To see which networks stations you have installed, use the command:
device list
Select a station from the ones listed and power it on by using the command:
device [selected station] set-property Powered on
Use the command above to turn on its corresponding adapter, only replacing "device" with "adapter" Then, you may either scan for networks or connect through WPS.
Use the following command:
wsc [selected station] push-button
And push the WPS button at the back of your router. This may take a minute or two to complete. Once the WPS LED on your router stops flashing, your computer has been connected to the internet!
Use the following command to scan for all of the access points you can currently connect to:
station [selected station] scan
Then, to display the networks, use the following command:
station [selected station] get-networks
Select an access point from the list provided and connect to it by using the following command:
station [selected station] connect [SSID]
IWCTL will prompt you to enter the access point's passphrase. Enter it and you should be connected to the internet soon after.
For a list of all the available keymaps, use the command:
localectl list-keymaps
To search for a keymap, use the following command, replacing [search_term]
with the code for your language, country, or layout:
localectl list-keymaps | grep -i [search_term]
loadkeys [keymap]
ping -c 4 archlinux.org
- If you are connected through Ethernet, then your Internet will be working out of the box.
- If you are using Wi-Fi, then use
wifi-menu
to connect to your local network. - If this step is successful then we will head to next one.
timedatectl set-ntp true
timedatectl
As of now, you don't have to worry about the timezone, just make sure that the UTC time it returns matches real-world UTC time
⚠️ Be extremely careful when managing your disks, incase you delete your precious data then DON'T blame me.
We are going to make two partitions on our HDD, EFI BOOT & ROOT
using gdisk
.
- IMPORTANT: Do not make a
/boot
partition if you are installing on an MBR system - If you have a brand new HDD or if no partition table is found, then create GPT Partition Table by pressing
g
.
gdisk /dev/[disk name] # If you are on an EFI system
fdisk /dev/[disk name] # If you are on an MBR system
- [disk name] = device to partition, find yours by running
lsblk
, this shows all the mountpoints and partitions of a disk. - We will be using separate partitions for our
/
,/boot
,/swap
&/home
. - Firstly, we will initialise the disk by using the commands below:
If you are on an EFI system:
x - Expert command
z - "Zap" the disk
y - Blank our MBR (Fully initialises the disk)
If you are on an MBR system:
q - To quit
sfdisk --delete /dev/[disk name]
Then, run gdisk or fdisk again.
n = New Partition
simply press enter = 1st Partition
simply press enter = As First Sector
+1G = As Last sector (BOOT Partition Size)
ef00 = EFI Partition Type
n = New Partition
simply press enter = 2nd Partition
simply press enter = As First Sector
+16G = As Last sector (SWAP size, or double your RAM, whichever is smaller)
8200 = Linux Swap
n = New Partition
simply press enter = 3rd Partition
simply press enter = As First Sector
+40G = As Last sector [ROOT Partition Size (you may use 20GiB if you have a small hard drive)]
8300 or simply press enter = Linux filesystem
n = New Parition
simply press enter = 4th Partition
simply press enter = As first sector
simply press enter = As last sector [HOME parition size (takes up remaining hard drive space)]
8300 or simply press enter = Linux filesystem
w = write & exit
It is ABSOLUTELY recommended to make a home partitition, for both security and convenience if you do decide to distro-hop.
IMPORTANT: From now on, your disk will be referred to as sdx, with x being the letter representing your drive.
mkfs.fat -F32 /dev/sdx1
mkfs.btrfs /dev/sdx3 # Add -f if your system tells you another filesystem like ext4 is already present
mkfs.btrfs /dev/sdx4
Format and turn on swap memory
mkswap /dev/sdx2
swapon /dev/sdx2
mount /dev/sdx3 /mnt
mount --mkdir /dev/sdx1 /mnt/boot
mount --mkdir /dev/sdx4 /mnt/home
Update Mirrors using Reflector (optional but recommended for faster download speeds, slow download speeds can time out)
reflector -c County1 -c Country2 -a 12 -p https --sort rate --save /etc/pacman.d/mirrorlist
Replace Country1
& Country2
with countries near to you or with the one you're living in. Refer to Reflector for more info.
Example:
reflector -c 'United States' -a 12 -p https --sort rate --save /etc/pacman.d/mirrorlist
pacstrap /mnt base base-devel linux linux-firmware linux-headers nano intel-ucode reflector mtools dosfstools
- Replace
linux
with linux-hardened, linux-lts or linux-zen to install the kernel of your choice. - Replace
linux-headers
with Kernel type type of your choice respectively (e.g if you installedlinux-zen
then you will needlinux-zen-headers
). - Replace
nano
with editor of your choice (i.evim
orvi
). - Replace
intel-ucode
withamd-ucode
if you are using an AMD Processor.
(use -U
or -L
to define by UUID or labels, respectively)
genfstab -U /mnt >> /mnt/etc/fstab
Note: A single
>
will overwrite a file and a double>>
will append to a file. Ensure you don't confuse these with each other, and make sure the commands you type are as how this guide has written it before you hit enter.
Check the resulting /mnt/etc/fstab
file, and edit it in case of errors. Do not touch the file if you don't know what its contents mean.
arch-chroot /mnt
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc # Sync hardware clock with system time
Replace Region
& City
according to your Time zone. To see what timezones are available, use the following commands:
ls /usr/share/zoneinfo/
and
ls /usr/share/zoneinfo/[Region]
An example of this would be:
/usr/share/zoneinfo/Europe/London
We will use en_US.UTF-8
here but, if you want to set your language, replace en_US.UTF-8
with yours in all below instances.
nano /etc/locale.gen
Uncomment the below line (or any line, depending on your region and what language your keyboard is in) by removing the hashtag preceeding the line
#en_US.UTF-8 UTF-8
save & exit.
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
For keyboard users with non US Eng only. Replace [keymap]
with yours.
echo "KEYMAP=[keymap]" > /etc/vconsole.conf
echo arch > /etc/hostname
Replace arch
with hostname of your choice.
nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 arch.localdomain arch
Replace arch
with hostname of your choice.
save & exit.
pacman -S networkmanager
systemctl enable NetworkManager
passwd
The bootloader is what manages the boot process, and is the PID 0 of your Arch system.
For MBR systems, we will install GRUB and for UEFI system, we will install SystemD-Boot
"Targets" are CPU architechtures. These are important for grub to know so it can handle the boot proess correctly.
Find your CPU architechture from this site and specify that as the target
pacman -S grub
grub-install /dev/[disk name] # You don't need to specify a target because the default is i386-pc
grub-mkconfig -o /boot/grub/grub.cfg
bootctl install
Open and edit /boot/loader/loader.conf
nano /boot/loader/loader.conf
Comment out any line beginning with default
by putting a hashtag at the beginning of the line.
And add this line to the bottom of the file
default arch.conf
Once that's done, type:
nano /boot/loader/entries/arch.conf
And define parameters as follows:
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID="[root partition UUID]" rw
You can find the root partition's UUID by typing into the command line (not your editor):
blkid /dev/sdx3
(Keeping in mind that sdx refers to the drive you want to install Arch Linux onto)
Save by hitting Ctrl+O, Enter, then Ctrl+X.
We need to make a similar file for the fallback image. To do that, type:
cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fb.conf
Edit the file:
nano /boot/loader/entries/arch-fb.conf
Change the below lines:
title Arch Linux
initrd /initramfs-linux.img
To (respectively):
title Arch Linux Fallback
initrd /initrams-linux-fallback.img
Save by hitting Ctrl+O then Enter, quit by hitting Ctrl+X.
⚠️ - Did you follow the above steps? That section is MANDATORY. Additionally, any mistakes made can and will cause your Arch system to fail its boot sequence.**
exit
reboot
useradd -mG wheel [username]
Replace [username]
with your username of choice.
passwd [username]
Repeat the above process as many times as you want, depending on the amount of users you want to add to your system.
If you do not want a user to use sudo commands, use the below command instead:
useradd -m [username]
EDITOR=nano visudo
#%wheel ALL=(ALL) ALL
save & exit.
exit
Since we're now using NetworkManager instead of iwd, our connection settings have been lost (and the connection process is slightly different)
Firstly, to take a look at what network stations you have installed on your computer, use the command:
nmcli device
Then, we turn on wifi by using the command:
nmcli radio wifi on
And we list local access points by using the command:
nmcli device wifi list
Select one of the access points listed and connect to it by running the following command:
nmcli device wifi connect [Access Point SSID] password [Access Point Password]
You don't need to check for updates as Arch will have already downloaded the latest version of Arch Linux
You can stop here if you want to do a server installation or have a desktop-less Arch system for any other reason.
sudo pacman -S xorg [xf86-video-your gpu type]
- For Nvidia GPUs, type
nvidia
&nvidia-settings
. For more info/old GPUs, refer to Arch Wiki - Nvidia. - For newer AMD GPUs, type
xf86-video-amdgpu
. - For legacy Radeon GPUs like HD 7xxx Series & below, type
xf86-video-ati
. - For dedicated Intel Graphics, type
xf86-video-intel
.
multilib contains 32-bit software and libraries that can be used to run and build 32-bit applications on 64-bit installs (e.g. Wine, Steam, etc).
Edit /etc/pacman.conf
& uncomment the below two lines.
#[multilib]
#Include = /etc/pacman.d/mirrorlist
This package is required by Steam if you play games using Vulkan Backend.
sudo pacman -Sy lib32-mesa
Note: The above install will not work if you don't specify -Sy
or type sudo pacman -Syy
beforehand.
sudo pacman -S sddm
sudo systemctl enable sddm
sudo pacman -S plasma konsole dolphin ark kwrite kcalc spectacle krunner partitionmanager packagekit-qt5
Packages | Description |
---|---|
plasma | KDE Plasma Desktop Environment. |
konsole | KDE Terminal. |
dolphin | KDE File Manager. |
ark | Archiving Tool. |
kwrite | Text Editor. |
kcalc | Scientific Calculator. |
spectacle | KDE screenshot capture utility. |
krunner | KDE Quick drop-down desktop search. |
partitionmanager | KDE Disk & Partion Manager. |
sudo pacman -S alsa-utils bluez bluez-utils
Packages | Description |
---|---|
alsa-utils | This contains (among other utilities) the alsamixer and amixer utilities. |
bluez | Provides the Bluetooth protocol stack. |
bluez-utils | Provides the bluetoothctl utility. |
sudo systemctl enable bluetooth.service
You can install all the following packages or only the one you want.
sudo pacman -S firefox openssh qbittorrent audacious wget screen git neofetch
Packages | Description |
---|---|
firefox | Mozilla Firefox Web Browser. |
openssh | Secure Shell access server. |
qbittorrent | Qt-based BitTorrent Client. |
audacious | Qt-based music player. |
wget* | Wget is a free utility for non-interactive download of files from the Web. |
screen | Is a full-screen window manager that multiplexes a physical terminal between several processes, typically interactive shells. |
git* | Github command-line utility tools. (needed to access the AUR) |
fastfetch | Fastfetch is a command-line system information tool, that is the sucessor to NeoFetch. |
cups* | Printer service |
* - These are some of the more important packages, which a lot of programs tend to use. They're optional but it is highly recommended to install all of them.
sudo systemctl enable sshd.service
sudo systemctl enable --now cups.service
reboot
Now everything is installed and after the final reboot
, you will land in the SDDM greeter. You can continue reading for some steps to further improve your experience. I recommend you to install yay
& paccache
.
- Yay will provide your packages from AUR (Arch User Repository), which are not available in the official repos.
- Paccache can be used clean pacman cached packages either manually or in an automated way.
Install Yay
Yet Another Yogurt - An AUR Helper. A lot of programs written for Arch can be founded in the AUR, but be careful of what you download from there.
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd .
rm -rf yay # To delete the yay folder as it isn't necessary anymore
Install Zsh
Zsh is a powerful shell that operates as both an interactive shell and as a scripting language interpreter. It's a preferred shell environment by many.
sudo pacman -S zsh zsh-completions
Read here for customisation & theming for Zsh. Read below how to change your SHELL.
Install NuShell
NuShell is a powerful shell that has really helpful debug statements and is overall a solid shell environment.
yay -S nushell
First check your current SHELL by running:
echo $SHELL
chsh -l
For an example, we will set Zsh as default SHELL which we installed in the last step:
chsh -s /usr/bin/zsh # To set Zsh as the default SHELL
chsh -s /usr/bin/nu # To set NuShell as the default SHELL
For the changes to apply, you will have Logout and Log back in or better do reboot
.
PipeWire is a new low-level multimedia framework. It aims to offer capture and playback for both audio and video with minimal latency and support for PulseAudio, JACK, ALSA and GStreamer-based applications.
sudo pacman -S pipewire wireplumber pipewire-audio pipewire-alsa pipewire-pulse
EasyEffects (former PulseEffects) is a GTK utility which provides a large array of audio effects and filters to individual application output streams and microphone input streams. Notable effects include an input/output equalizer, output loudness equalization and bass enhancement, and input de-esser and noise reduction plug-in. Install
sudo pacman -S easyeffects
# or
yay -S easyeffects-git
This will also install pipewire-pulse and replace PulseAudio with PipeWire.
Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates.
sudo pacman -S clamav
sudo freshclam
sudo systemctl enable --now clamav-freshclam.service
sudo systemctl enable --now clamav-daemon.service
GUI for ClamAV
sudo pacman -S clamtk
Download the latest master zip
from ClanTK-KDE Gitlab & extract it your ~/Downloads
folder. Now open a terminal from within the extracted folder & run:
sudo cp clamtk-kde.desktop /usr/share/kservices5/ServiceMenus/
Install Oh My Zsh
Oh My Zsh is an open source, community-driven framework for managing your Zsh configuration.
sh -c "$(wget https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
My favourite theme is Powerlevel10k (follow below for installation).
- You can visit here to download theme of your choice.
Get Powerlevel10k Theme for Oh My Zsh
This is the theme I'll install to spice up my terminal experience.
git clone --depth=1 https://github.com/romkatv/powerlevel10k.git ${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k
We will be using Yay to install the below two packages as one of them is only available from AUR.
yay -S ttf-dejavu ttf-meslo-nerd-font-powerlevel10k
Also set your Konsole Terminal font to MesloGS-NF-Regular
.
nano ~/.zshrc
Find the line starting with ZSH_THEME="...."
and replace the theme name so the line should now look like this ZSH_THEME="powerlevel10k/powerlevel10k"
Now do source ~/.zshrc
.
For new users, on the first run, Powerlevel10k configuration wizard will ask you a few questions and configure your prompt. If it doesn't trigger automatically, type
p10k configure
. Configuration wizard creates~/.p10k.zsh
based on your preferences. Additional prompt customization can be done by editing this file. It has plenty of comments to help you navigate through configuration options.
Kvantum is a SVG-based theme engine for Qt, tuned to KDE and LXQt, with an emphasis on elegance, usability and practicality.
yay -S kvantum-qt5-git
Or
sudo pacman -S kvantum
Pacman Cache Cleaner.
Install
sudo pacman -S pacman-contrib
To manually clean pacman cache, run
sudo paccache -rk
Where, k indicates to keep "num" of each package in the cache.
Create a file in /etc/pacman.d/hooks
sudo mkdir /etc/pacman.d/hooks
sudo nano /etc/pacman.d/hooks/clean_cache.hook
Add the following lines in it
[Trigger]
Operation = Upgrade
Operation = Install
Operation = Remove
Type = Package
Target = *
[Action]
Description = Cleaning pacman cache...
When = PostTransaction
Exec = /usr/bin/paccache -rk
save & exit.
Install Cockpit
A systemd web based user interface for Linux servers, Workstations and even Desktops. Can be used to monitor your system stats, performance and perform various settings including updating of your system.
sudo pacman -S cockpit
sudo systemctl enable --now cockpit.socket
Now open your browser and point to it your-machine-ip:9000
and login with root to get full access.
- 2024-06-25
- A lot of changes, improvements, and updates. Special thanks to our biggest contributor @bahmoudd