This is my unofficial Arch Linux installation guide for very beginners with basic Linux/Computing knowledge, who wish to start using Arch Linux, but finds it impossible to install. Things to note:
- Tutorial does not go much into the details, so consider this tutorial only as a starting point.
- This is UEFI based Arch Linux installation. If you are installing in BIOS mode - your partitioning and grub set-up will be different.
- 1 Basic Arch Linux installation
- 1.1 Understanding the installation
- 1.2 Internet connectivity
- 1.3 Partitioning
- 1.4 Install base Arch Linux system
- 1.5 Create fstab
- 1.6 Enter the chroot mode
- 1.7 Set up locale
- 1.8 Set up timezone
- 1.9 Set the hardware clock
- 1.10 Set the hostname
- 1.11 Set the password
- 1.12 Install bootloader
- 1.13 Install other required packages
- 1.14 Reboot
- 2 Make functioning desktop out of basic installation
- 2.1 Internet connectivity
- 2.2 Create regular user
- 2.3 Install Xorg video server
- 2.4 Install XFCE desktop environment
- 2.5 Install NetworkManager
- 2.6 Install LightDM login manager
- 2.7 Install Pulseaudio packages
- 2.8 Install browser
- 2.9 Install monospace font
- 2.10 Reboot
- 2.11 Install user directories
- 2.12 Install trizen
- 3 Further reading
- 4 How to fix completely broken system
Basic Arch Linux installation
Understanding the installation
- Boot up Arch Linux from USB stick (live mode).
- Set up internet connectivity.
- Set up partitions.
- Format partitions.
- Mount partitions.
- Install Arch Linux to partitions.
- Generate FSTAB partitions scheme to Arch Linux installation.
- Chroot (AKA "login") to Arch Linux installation.
- Basic configuration - timezone, locale, hostname, root user password etc...
- Install some required packages (for first boot).
- Set up GRUB bootloader.
At the end of this page I will also give few tips on how to further set up complete desktop on this basic arch linux installation.
Test internet connection
ping www.google.com to see if you are getting responses from a Google's server.
Connect to a WiFi
wifi-menu to use automated step by step program to connect to WiFi. Follow the instructions and you should be good to go. Test internet connectivity afterwards with
wifi-menu wlpxxxxxxxxxinstead, where
wlpxxxxxxxxxcan be found with command
lsblk -f to see the information about your detected hard drives and their partitions.
Destroy all partitions
This completely destroys all data on your hard drive:
# sgdisk --zap-all /dev/sda
Create 2 partition on your hard drive - one is for EFI installation, second is for Arch Linux installation. Type command
cgdisk /dev/sda 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.
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.
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/sda1
Then format second partition (the one that has the rest of hard drive space):
# mkfs.ext4 /dev/sda2
Mount your prepared partitions so you can write some data (files) to them:
Mount first the second partition (the one that has the rest of your hard drive size) to /mnt directory :
# mount /dev/sda2 /mnt
boot folder in mounted partition:
# mkdir /mnt/boot
And mount EFI partition to that
# mount /dev/sda1 /mnt/boot
lsblk -f to confirm if you successfully mounted your partitions.
Install base Arch Linux system
First, go to
# cd /etc/pacman.d/
Then comment out every mirror in pacman mirrors list:
# sed -i 's/^Server/#Server/' mirrorlist
Then edit the file:
# nano mirrorlist
And uncomment only preferred mirrors (from the same or nearby countries). For example - uncommented mirror from Lithuania:
## Lithuania Server = http://mirrors.atviras.lt/archlinux/$repo/os/$arch
Perform this command to install base Arch Linux installation to
# pacstrap /mnt base base-devel
Fstab file contains what and how must be mounted before booting up. 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
Just run this and follow the steps:
Then 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 --utc
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 there is almost 100% chance your system will not boot.
Then (re)generate GRUB config file:
# grub-mkconfig -o /boot/grub/grub.cfg
Install other required packages
Common networking applications
I believe these are must packages to have for fully functioning system. Later or sooner you will need them, so install:
# pacman -S net-tools wireless_tools dialog iw wpa_supplicant
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
Exit the chroot mode:
And GRUB menu should show up when computer starts to boot. After it the system boots. Login will be user root and the password you set previously.
Make functioning desktop out of basic installation
Below are the steps to set up fully functioning desktop (GUI) on your PC/Laptop. Again - this is intended for beginners, therefore I am not going much into the details. Consider you already booted up to your installed Arch Linux system.
Same steps as per User:Erkexzcx#Internet_connectivity.
Create regular user
First create new user with its home directory:
# useradd --create-home name
Then set user password:
# passwd name
Add user to
# gpasswd -a name wheel
Allow user to gain root access
Install sudo package:
# pacman -S sudo
nano editor edit sudoers file:
# nano /etc/sudoers
And uncomment this line (delete
# in front of it):
# %wheel ALL=(ALL) ALL
Then save that file.
sudocommand, then uncomment
# %wheel ALL=(ALL) NOPASSWD: ALLinstead.
Install Xorg video server
# pacman -S xorg-server
Install XFCE desktop environment
# pacman -S xfce4 xfce4-goodies
Install required packages with this command:
# pacman -S networkmanager network-manager-applet gnome-keyring
Then enable NetworkManager on boot:
# systemctl enable NetworkManager.service
And your system automatically connects to WiFi/Ethernet on boot. Going forward, usage from terminal:
If you want to use from GUI - the network manager applet should appear in your XFCE panel.
Install LightDM login manager
# pacman -S lightdm lightdm-gtk-greeter
Then enable lightdm on boot:
# systemctl enable lightdm.service
Install Pulseaudio packages
Install Pulseaudio audio server as well as few additional configuration packages (applications):
# pacman -S pulseaudio pulseaudio-alsa alsa-utils pavucontrol
trizencommand (pacman wrapper}.
# pacman -S firefox
Install monospace font
If you do not install this, then your terminal (in desktop environment) fonts will be broken (characters overlapping):
# pacman -S ttf-dejavu
Reboot the system. After reboot you should see lightdm login manager - login using your created user to XFCE desktop environment.
alsa-mixerto unmute/configure it. You might also need to add pulseaudio mixer to XFCE panel in order to change audio with a mouse.
Install user directories
Install required package:
# pacman -S xdg-user-dirs
Then execute this command:
Then default directories in your home directory will be created (like Downloads or Desktop).
Install it by executing below commands (P.S. This is how packages from AUR are being installed manually):
$ wget https://aur.archlinux.org/cgit/aur.git/snapshot/trizen.tar.gz # Download compressed AUR package script files $ tar -xvzf trizen.tar.gz # Decompress those files $ cd trizen # Enter decompressed folder $ makepkg -si # Download dependencies, build package and install it $ trizen # Execute once to generate config file
Example of installing Google Chrome from AUR:
$ trizen -S google-chrome
Example of installing Firefox from official repositories:
$ trizen -S firefox
trizencommand and at the end of output, you will see full path to config file. Edit it and change line
ask_for_retry => 0to
ask_for_retry => 1and also change
noedit => 0to
noedit => 1.
I suggest reading these Arch Wiki pages to get familiar with Arch Linux and Arch Wiki:
- Find your hardware specific pages (e.g. ASUS_Zenbook_UX430/UX530 or ASUS_N550JV).
- Fan_speed_control, especially Fan_speed_control#NBFC.
- 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/sda2 /mnt # Mount /dev/sda2 on /mnt directory # mount /dev/sda1 /mnt/boot # Mount /dev/sda1 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