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 up datetime synchronisation
- 1.11 Set the hostname
- 1.12 Set the password
- 1.13 Install bootloader
- 1.14 Install other required packages
- 1.15 Reboot
- 2 Make functioning desktop out of basic installation
- 2.1 Understanding steps
- 2.2 Internet connectivity
- 2.3 Create regular user
- 2.4 Install Xorg video server
- 2.5 Install XFCE desktop environment
- 2.6 Install NetworkManager
- 2.7 Install LightDM login manager
- 2.8 Install Pulseaudio packages
- 2.9 Install browser
- 2.10 Install monospace font
- 2.11 Reboot
- 2.12 Install user directories
- 2.13 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 those mounted partitions.
- Generate FSTAB partitions scheme (so it knows how to mount everything before booting up)
- Chroot (AKA "login") to Arch Linux installation.
- Basic configuration - timezone, locale, hostname, root user password
- Set up GRUB bootloader (it boots your system)
- Install some required (common) packages.
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.
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.
wifi-menu to use automated step by step program to connect to WiFi. Follow the instructions and you should be good to go.
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
/dev/sda 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 (I suggest boot).
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 linux).
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 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 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.
- Connect to the internet (we will be downloading packages)
- Create regular user (and allow it to have root permissions)
- Set up graphics:
- Install Xorg video server (do not confuse - this is not a driver.)
- Install XFCE Desktop Environment
- Install LightDM login manager
- Install Pulseaudio audio server (allows to have audio)
- Install NetworkManager (manage internet connectivity)
- Finishing touches:
- Fix broken fonts (arch linux issue)
- Set up user directories (desktop, downloads, documents...)
- Install Web browser
- Install Trizen (install AUR packages with "pacman")
Note that most of the steps does not need to be performed in order! :)
Same steps as per #Internet_connectivity.
Create regular user
First create new user with its home directory:
# useradd --create-home name
Then set user password:
# passwd name
Allow user to gain root access
Install sudo package:
# pacman -S sudo
nano editor edit sudoers file:
# EDITOR=nano visudo
And uncomment line
# %wheel ALL=(ALL) ALL by changing to
%wheel ALL=(ALL) ALL.
Then add your regular user to
# gpasswd -a name wheel
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 lightdm-gtk-greeter-settings
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 applet 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 - 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/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