Major advantages of Arch Linux are: distro
- It is not a bloated distro: Arch doesn’t ship with software packages that might not be of any use to the user. Arch let you install only the things you really need, this let you strip unnecessary features that comes by default with many Linux distros like Ubuntu, Fedora, OpenSUSE e.t.c. You build a lean and fast system.
- AUR ( Arch User repository) is really amazing, easy and peasy. It gives you access to lots of software packages not available in official repositories. This is a plus as compared to other Linux systems.You can use PKGBUILD without any manual intervention.
- Pacman package manager that automatically compile packages for you.
- Rolling release: This means you won’t have to reinstall your system. You always have newest packages in your system since all the packages are vanilla, practically pure from upstream
- Arch has a very detailed wiki making it best Linux reference, not only providing Arch Linux tutorials and how to, it gives you general Linux knowledge.
How to install Arch Linux is a bit complicated as compared to many other Linux distributions. There are projects aimed at simplifying Arch Linux installation, these include Manjaro, Antergos, Apricity,Ninja and many others. You can try simplifying installation of Arch Linux with those distributions if you don’t have all the time to build your Arch from the ground up.
How to install Arch Linux – Motivation
This mini-ebook was written to help you build your own Arch Linux desktop or server without the need of pre-build distros. I will provide here overview of the common ways to boot the installation media and get started. Remember that any installation of Arch needs an active internet connection since its installation process retrieves packages from a remote repository. You can do an offline installation of packages but I don’t recommend this method since it requires deep understanding of Arch Linux and Linux system in general.
Most guidelines provided here are simplified wiki’s. You can use my ebook alongside Arch’s wiki documentation. I’ve used a lot of screenshots and pictures for illustration purposes and to help new users follow along easily.
If you’re installing an Arch-based Linux distribution like Manjaro or Antergos, you may have to skip some parts of this section because they do offer GUI installer. It is a point to note that Arch installation is done in text mode (using terminal) only.
Download Arch ISO
You can install Arch using bootable DVD or USB flash drive/key/stick for booting in BIOS and UEFI systems. A LiveUSB, LiveCD system can be used for installing Arch Linux, perform system recovery or maintenance. It is to be noted that live media uses SquashFS which discards all changes once the computer shuts down.
Complete steps of installing Arch Linux are as outlined below.
Create bootable medium
1.1.1: Create bootable USB flash stick on a Linux system.
The best tool to create a bootable ISO on a Linux host is dd command. Make sure you’ve selected correct drive before issuing dd command, failure to may render your external storage drive unusable.
I recommend you use lsblk command to confirm usb drive.
My USB drive is on /dev/sdb.The syntax for creating bootable USB stick with dd command is:
Below example will create bootable arch from iso located in /home/josepy/Downloads (input file) to device at /dev/sdb ( output file) , using block size of 4M, showing transfer progress and doing sync to complete before ejecting.
1.1.2: Using Manual Formatting:
For this method to work, you should have syslinux package installed. If you’re running Arch, do:
I suppose you have a flash drive with targeted partition as /dev/sdb2 that must be formatted to FAT32. We’ll create a directory to mount Flash drive partition and ISO image.
1.2 Create bootable USB flash stick on Windows.
1.2.1: Using Rufus software package
Download Rufus USB Partitioner http://rufus.akeo.ie/
When you run it, you have two partition schemes options to select from:
- MBR for BIOS
The file system of FAT32 is required.
1.3 Boot and start Installation
Choose ” Boot Arch Linux ( Architecture)”, since my machine is 64-bit, i will choose ” Boot Arch Linux (x86_64)”, then press enter key.
See below image.You’ll be dropped on root terminal with like below:
Now it’s time to start partitioning hard drive.
We’ll need three partitions. Partitioning can be done from existing/ other installed Linux system using GUI tools like gparted. Then just pointing root, home and swap partitions to respective partitions created earlier. Using GUI tools is a recommended method if you’ll be dual booting with other Linux
- Root partition
- Home partition
- Swap partition
First, check your disk location using lsblk command:
As you can see, my internal hard drive is /dev/sda. I will partition it to get three partitions. I’ll use fdisk command to do this:
The syntax is,
Since my drive is /dev/sda, it will be:
1.4.1 Create root partition
I’ll create a 10GB root partition, steps are
- Type fdisk /dev/sda
- Press n to create a new partition
- Press p to specify the primary partition type
- Press enter for default partition number
- Press Enter key for default First sector
- Type +10G to specify 10GB disk size for the root partition. Replace it with your value. M for MB, G for GB, T for terabyte e.t.c
- Type w to write changes to the partition table.
1.4.2 Create Home partition
Repeat the same process as in 1.4.1 to create a home partition, 1.4.3 Create a Swap partition￼
Repeat the same procedure as in 1.4.2 and 1.4.3 to create a swap partition.
You can view partition table by typing;
Then press p
We’ve successfully created three partitions, which are:
- Root partition on /dev/sda1
- Home partition on /dev/sda2
- Swap partition on /dev/sda3
1.4.4 Create a filesystem on created partitions
See image below
1.4.5 Mount the partitions
Create dir for mounting /dev/sda2
1.5 Install the base packages
Before you begin installation of base packages, it’s advisable to choose mirror closest to you. You can do this by editing the mirrorlist file located in /etc/pacman.d/ directory.
1.5.1 Modify Mirror list
Locate mirror close to you, then move it to the top, below nano keys can help you do easy navigation and copy-pasting:
- Ctrl + w : To do searching
- Alt+6: To copy a line
- page-up: To go to the top of the file
- Ctrl+ U: To paste a line
- Ctrl+X: To save changes, then press Y then enter key.
Since I reside in Africa, the mirror closest to my location is
1.5.2 Configure Networking
> Check if you have an ip address, if not and have DHCP, request for IP related information.You can request for IP via DHCP by
Then test if you’ve internet connection by doing a ping test
On the popup window, Select your Wireless network then Press OK.
Set profile name and Press OK
If it has security key, enter it and press OK.
pacstrap [options] root [packages…]
-c : Use the package cache on the host, rather than the target
-d : Allow the installation to a non-mountpoint directory
-G : Avoid copying the host’s Pacman keyring to the target
-i : Avoid auto-confirmation of package selections
-M : Avoid copying the host’s mirrorlist to the target
-h : Print help message
Now do the pacstrap installation of base and base-devel
1.5.3 Create Local Repository
NOTE: THIS IS NOT DONE ON THE INSTALLATION MACHINE !!!
If you have an already installed Arch Linux system on your network, it’s not necessary to redownload base packages from the internet. This will help you save bandwidth if you’re on slow internet connection. I’m going to show you a trick on how to set local repo based on pre-installed Arch Linux. I have another running Arch Linux on my network with IP address:
IP address of Arch being installed as seen from previous ifconfig command is: 192.168.122.203
- On installed Arch Linux, i’ll setup Apache web server server:
Then start Apache web server:
Check status of httpd to make sure it’s running
- Next step is to create directory to house pacman packages on installed Arch Linux Apache’s root directory.
Rsync all packages at /var/cache/pacman/pkg directory to /srv/http/arch .
Change group ownership of /srv/http contents to http.
Wait for it to complete, then
- Go back to machine you’re installing New Arch Linux on. Modify pacman.conf file:
– Comment out core, extra and community repos, to look like below:
See below image:
- Run pacstrap to install base packages:
After successful installation of base packages, you can move on to system configurations stage.
1.6 System configurations
1.6.1 Generating fstab file for auto-mounting partitions
fstab is a static information about the filesystems which contains descriptive information about the filesystems the system can mount. It is only read by programs. It is your duty to properly create and maintain this file.
Arch installation comes with a package called genfstab which tries to automate this process for you. genfstab generates output suitable for addition to an fstab file based on the devices mounted under the mount point specified by the given root.
Options that can be used with genfstab are:
-p Exclude pseudofs mounts (default behavior)
-P Include printing mounts
-t TAG Use TAG for source identifiers
-U Use UUIDs for source identifiers (shortcut for -t UUID)
-h Print help message
The syntax of usage is:
# genfstab [options] root
To generate fstab file, type
You can check generated fstab file and modify if necessary.
Then chroot to run command or interactive shell with special root directory of /mnt
# arch-chroot /mnt/
If you had set local custom repository and would like to use it in the next installations, issue below commands before typing arch-chroot /mnt
# cp /etc/pacman.conf /mnt/etc/pacman.conf # cp /etc/pacman.d/mirrorlist /mnt/etc/pacman.d/mirrorlist
1.6.2 Set timezone
Since my timezone is Africa/Nairobi, i will issue command:
# ls -s /usr/share/zoneinfo/Africa/Nairobi > /etc/localtime
You can find your timezone by going through the list of timezones.
# ls -l /usr/share/zoneinfo
1.6.3 Generate correct locale
Since i’m using US english, my locale will be set to en_US.UTF-8.
# mylocale=en_US # sed -i '/en_US.UTF-8/s/^#//g' /etc/locale.gen # echo LANG=$mylocale.UTF-8 > /etc/locale.conf
1.6.4 Set the hostname
The syntax is:
# echo hostname > /etc/hostname
In my case:
# echo archy > /etc/hostname
1.6.5 Enable multilib repository
# nano /etc/pacman.conf
Uncomment multilib repository to look like below.
[multilib] Include = /etc/pacman.d/mirrorlist
This is necessary if you’re running 64-bit system and would like to install 32-bit packages on it.
1.6.6 Add AUR repo
Add the following AUR repo content at the end of pacman.conf file.
[archlinuxfr] SigLevel = Never Server = http://repo.archlinux.fr/$arch
1.6.7 Install boot loader
Install Grub bootloader. Since this installation of Arch is on PC using BIOS, we don’t need a different partition to install bootloader on. If you’re using UEFI, consult Arch Wiki for details on how to set it up.
# pacman -S grub
# grub-install /dev/sda/
If you encounter any problem trying to install grub, use –force flag:
# grub-install /dev/sda --force
220.127.116.11 Install os-prober
Os-prober utility is necessary if you have more than one OS on your machine. It will automate the process of adding other operating systems to grub menu for easy dual booting. Install it by typing:
# pacman -S os-prober # os-prober
18.104.22.168 Generate a GRUB configuration file
# grub-mkconfig -o /boot/grub/grub.cfg
1.7 Install Crucial software packages
It’s a rule of thumb to do system update and upgrade before installing any package:
$ sudo pacman –Syu
- Install bash
- Install X server
3. Install Mesa 3D acceleration if you don’t want to install proprietary ones.
4. Install Touchpad drivers
5. A single command to get X working is:
Install Audio drivers
- Install net-tools
Net-tools package provide network management tools. Arch comes with ifconfig replacement tool ip. To use ifconfig, net-tools package is required.
- Install sudo
Sudo allows a permitted user to execute a command as the superuser or another user, as specified by the security policy.
- Install dhclient – Dynamic Host Configuration Protocol Client
Dhclient, provides a means for configuring one or more network interfaces using the Dynamic Host Configuration Protocol and BOOTP protocol.
1.8 Add standard user account
Installed Arch comes only with root account. In this section, we’re going to add standard user account:
- Set root password:
Enter your desired password and confirm.
- Add new user to the system.
- Set password for the user
# passwd $username
Enter desired password for the account and confirm .
- If you want the added user, a member of group wheel to execute any command, do the following:
> Set EDITOR to your favorite
# echo export EDITOR=vim >> ~/.bashrc
> Run visudo command
And uncomment the line
Then save and quit.
1.9 Install your favorite Desktop Environment
All linux systems are Desktop Environment agnostic. You can install any DE you want, at any time. I’m a big fan of KDE but i’ve used almost all Linux DE. In this section i will guide you through installation of top Linux Desktop Environments. The list is as shown below.
1.9.1 Install KDE plasma Desktop Environment
# pacman -S plasma kde-applications-meta plasma-mediacenter # systemctl enable sddm.service
1.9.2 Install Gnome Desktop Environment
# pacman -S gnome gnome-extra gnome-tweak-tool
Then install GDM display manager:
# pacman -S gdm
Start and enable gdm to start at boot:
# systemctl enable gdm
1.9.3 Install xfce Desktop Environment
# pacman -S xfce4 xfce4-goodies xfce4-mixer gstreamer0.10-good-plugins libxnvctrl xscreensaver
1.9.4 Install cinnamon Desktop Environment
# pacman -S cinnamon nemo-fileroller
# pacman –S gdm
Enable gdm to start at boot and start it
# systemctl enable gdm
Upto this point, you’ve finished install Arch Linux on your machine, so, Kudos!!.
You can now exit chroot , unmount partitions and reboot your system.
# exit # umount -R /mnt/ # reboot
If you Love what we do, support us by downloading this tutorial as pdf from the link below:
Once it’s done rebooting, you’ll see a Login screen. Since i’m using KDE, my Login screen looks like below:
Upto this point, We’ve completed a how to Install Arch Linux, if you’re here i know you’ve a running Arch with DE. Computinforgeeks have many tutorials on Linux and Arch Linux.
How to install Arch Linux from scratch
How to install Arch Linux on a Desktop, PC or server
Installing Desktop Environments on Arch Linux
How to install KDE, XFCE, GNOME 3 and others.
Arch Linux basic softwares installation