Welcome to the “Arch Linux Install Guide – Step 1: Basic Installation“. In this guide I will show how to get started with Arch Linux using simple steps!
Downloading Arch Linux
Just visit the official download page to grab a copy of Arch Linux. Alternatively, use this magnet link directly to safe some time: Arch Linux Torrent
Create a bootable USB
From Linux
sudo dd bs=4M if=/path_to_arch_.iso of=/dev/sdX && sync
(Here sdX is the USB drive. Please remember don’t use any numbers, for example, if your drive is detected as sde, don’t use sde1, instead just use ‘sde’).
From Windows using USBwriter
This method does not require any workaround and is as straightforward as dd under Linux. Just use with local administrator rights the USBwriter utility to write to your USB flash memory.
Remark: You should also be able to use the Universal USB Installer, but with some additional steps as the ArchWiki states.

Hard Drive Partitioning
In this step we will partition the hard drive to our needs. If you have already done this or I you are migrating from another distro, you can go to the next step (”Installing the Filesystem”).
Of course the easy way is to do it using a graphical partition tool – especially if you are a beginner or you don’t trust yourself. I recommend to use some live-CD from other distros, such as Ubuntu Live CD. There, you can use Gparted to partition your disk. But, if you like the command line follow the next steps.
I am using GPT instead of MBR (there are many advantages of GPT over MBR), Arch comes with a couple of partitioning tools, but for GPT ‘cgdisk‘ is used. However if you are dual booting with Windows or if you already have another distro installed, or for some reason you want to keep MBR, use cfdisk instead of cgdisk. The procedure is same just run cfdisk command instead of cgdisk.
Run lsblk command to see the partition structure of the hard drive on which you want to install Arch. In my case it’s sda.
lsblk
To start partitioning, run this command:
cgdisk /dev/sda
Example output:
Note: If you are using cfdisk command for MBR, you don’t need to create BIOS Boot Partition, so skip Boot Partition step.
Boot Partition
BIOS-GPT requires BIOS Boot Partition at the beginning of the disk. The Free Space is already selected and then
- Hit New -> Enter
- First Sector -> Enter
- Size in Sector -> 1007KiB -> Enter
- Hex Code of GUID (L to show pres, Enter = 8300) -> ef02 ->Enter
- Enter partition name – > Enter
You will notice a 1007.0 KiB BIOS boot partition has been created.
Create root
Use keyboard to select the free space
- Hit New -> Enter
- First Sector -> Enter
Now it will ask you how much space you want to allocate to that partition. In my case I will give root over 20GB - Size in Sector -> 20GB -> Enter
- Hex Code of GUID (L to show pres, Enter = 8300) -> Enter
- Enter partition name – > Enter
Now you will see a 20GB partition has been created.
Creating Swap
I have SSD on my desktop with 8GB of RAM and I really don’t need suspension or hibernation so I don’t bother to create swap. Depending on your need, you can create swap. Use keyboard and select Free Space
- Hit New -> Enter
- First Sector -> Enter
Now it will ask you how much space you want to allocate to that partition. I would give 2GB for swap (check what’s recommended) - Size in Sector -> 2GB -> Enter
- Hex Code of GUID (L to show pres, Enter = 8300) -> Enter
- Enter partition name – > swap
Swap has been created.
Creating home
Use keyboard and select Free Space
- Hit New -> Enter
- First Sector -> Enter
Now it will ask you how much space you want to allocate to that partition. Here I am giving the remaining space to home. - Size in Sector -> 50GB -> Enter
- Hex Code of GUID (L to show pres, Enter = 8300) -> Enter
- Enter partition name – > home -> Enter
If everything looks good select `Write‘, which will ask you to confirm if you want to write the changes. Type `yes‘ if you are sure. Once done select `Quit‘.
You can check the structure of partition by running this command:
lsblk
The command will show you the partition structure.
What you have to note here is the name of each partition so we can format them accordingly. In my case it was:
sda1 – BIOS Boot
sda2 – root
sda3 – swap
sda4 – home
It may be different in your case so choose accordingly.
Installing the Filesystem
Connecting to the Internet
It is recommended that you use the Ethernet connection for installation as your PC might need drivers for the wireless chip and it will only complicate things.
Of course you can check and see if your Wireless Lan Interface is working:
ip link
If you are lucky and it is listed there, you can try connecting to the Internet via Wifi. Since I forbid you to connect to Wifi-Networks that use WEP encryption, below are the steps to connect to a Wifi-Network that uses WPA 1/2 encryption.
Connect to your Wifi-Network running:
wpa_passphrase <passphrase> | wpa_supplicant -B -i <SSID> -c /dev/stdin
Finally, provide an IP address to the network interface:
dhcpcd
Now, check if you are online:
ping -c 3 www.google.com
Note: If for some reason the dhcpcd command hangs, run:
pkill dhcpcd
and then re-run:
dhcpcd
Formatting the Disk
If you hard-drive is ready and partitioned to your needs, you can move on formatting it.
Format “root” partition (sdaX):
mkfs.ext4 /dev/sdaX
If you have a “home” partition (sdaY):
mkfs.ext4 /dev/sdaY
And format SWAP (sdaZ):
mkswap /dev/sdaZ swapon /dev/sdaZ
In order to make sure everything is correct check your partitions with this command:
lsblk /dev/sda
Mounting Partitions
Before we can download and install the base packages of Arch Linux we need to mount our partitions and switch to our root directory. After all, this where we are going to install Arch Linux.
First we need to mount root partition and then create home directory.
mount /dev/sdaX /mnt
Then create the home directory:
mkdir /mnt/home
Now mount home:
mount /dev/sdaY /mnt/home
Choose Download Mirror
Choose the mirror closest to you for better download speeds. To edit the mirror list run this command:
nano /etc/pacman.d/mirrorlist
Hint: In nano use Ctrl+W and type the location you are looking for, once found go to the url of the mirror and hit Alt+6 to copy the line. Now use <Page Up> key to go on top and then hit Ctrl+U to paste that line on top. Hit Ctrl+x to exit and then type Y to save the changes you made.
Install Base Packages
Now we are about to install base and base-devel packages. Run this command:
pacstrap -i /mnt base base-devel
Configure fstab
To configure fstab (file systems table) run:
genfstab -U -p /mnt >> /mnt/etc/fstab
NOTE: Run the above command only once even if there are any issues. If there are problems, edit fstab manually, don’t re-run the command.
You must always check if fstab entry is correct or you won’t be able to boot into your system. To check fstab entry, run:
nano /mnt/etc/fstab
If everything is OK you should see root and home mounted.
It is time now to change to your newly installed root directory to configure it.
arch-chroot /mnt
Language and Time Zone Settings
To configure the language of the system run the following command:
nano /etc/locale.gen
un-comment the one you need. In my case I am using:
en_US.UTF-8 UTF-8
Now run
locale-gen echo LANG=en_US.UTF-8 > /etc/locale.conf export LANG=en_US.UTF-8
To see all available Time Zones run:
ls /usr/share/zoneinfo/
Now you can configure the zone:
ln -s /usr/share/zoneinfo/<zone> /etc/localtime
In my case I am using UTC:
ln -s /usr/share/zoneinfo/UTC /etc/localtime
Let’s now configure the hardware clock, just in case we had a wrong date:
hwclock --systohc --utc
Set your hostname
To set your desired hostname for your system run:
echo <YOUR_HOSTNAME> > /etc/hostname
Create User(s)
Create the user of your system by running:
# useradd -m -g [initial_group] -G [additional_groups] -s [login_shell] [username] useradd -m -g users -G wheel,storage,power -s /bin/bash <username>
Then give the password for this new user by running:
passwd <username>
Don’t forget to set also the password for the root user:
passwd
Now we have to allow this use to do administrative jobs as sudo so let’s install sudo. Also install bash-completion for auto-completing commands.
pacman -S sudo bash-completion
Once that is done, we will now allow the users in wheel group to be able to performance administrative tasks with sudo. Run the following command to edit the sudoers:
EDITOR=nano visudo
It will open the sudoers file where you have to uncomment this line:
%wheel ALL=(ALL) ALL
The pacman Package Manager
In ArchLinux you will have to install new software using pacman it’s very easy actually.
If you want to install something you only need to run:
sudo pacman -S
If you want to search for a package:
sudo pacman -Ss
If you want to remove a package:
# To remove a single package, leaving all of its dependencies installed sudo pacman -R # To remove a package and its dependencies which are not required by any other installed package sudo pacman -Rs # To remove a package, its dependencies and all the packages that depend on the target package: # Warning: This operation is recursive, and must be used with care since it can remove many potentially needed packages. sudo pacman -Rsc # To remove a package, which is required by another package, without removing the dependent package sudo pacman -Rdd # pacman saves important configuration files when removing certain applications and names them with the extension: .pacsave. # To prevent the creation of these backup files use the -n option: pacman -Rn # Force refresh of all package lists pacman -Syy
System Update/Upgrade
And if you want to update your system:
sudo pacman -Syu
OR if you have installed yaourt (yaourt is covered up next) and want to update it together with the AUR packages:
yaourt -Syua
Important Remark
Before you update your system or if you see some “weird” behaviour when trying to update it, please check the latest news in Arch Linux official page for any announcements! It might be the case for some manual intervention to your system before you can update it! Or else the update/upgrade will fail.
pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically, therefore it is necessary to deliberately clean up that folder periodically to prevent such folder to grow indefinitely in size. The built-in option to remove all the cached packages that are not currently installed is:
pacman -Sc
To list all packages no longer required as dependencies (orphans):
pacman -Qdt
and to delete them (apt-get autoremove):
pacman -R $(pacman -Qdtq)
What I recommend you to do before starting installing everything that you want is to enable multilib repositories.
Go ahead and edit the pacman configuration file in /etc/pacman.conf:
Uncomment both lines
[multilib] Include = /etc/pacman.d/mirrorlist
Don’t install Yaourt! Use other alternatives for AUR
Yaourt (Yet AnOther User Repository Tool; French for ‘Yogurt’) is a community-contributed wrapper for pacman which adds seamless access to the Arch User Repository AUR, allowing and automating package compilation and installation from your choice of the thousands of PKGBUILDs in the AUR, in addition to the many thousands of available Arch Linux binary packages.
There are many alternatives for Yaourt. I would recommend installing yay.
But first we need to enable AUR. You will need to add a repository to the pacman configuration file:
nano /etc/pacman.conf
and add to the end of the file:
[archlinuxfr] SigLevel = Never Server = http://repo.archlinux.fr/$arch
Installing yay
You can install yay by cloning the git repo and building it. Use the below command to install yay in Arch Linux :
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Using yay
Searching an application through Yay in AUR:
yay -Ss
Installing an application:
yay -S
Advanced Linux Sound Architecture (ALSA)
Now we are going to install the API for sound card device drivers, in order to get some sound out of our machine:
pacman -S alsa-utils pulseaudio
Plugins for mp3 playback and other media:
pacman -S alsa-oss alsa-lib
ALSA by default has all channels muted, all of which will need to be unmuted manually. This can be done using amixer:
amixer sset Master unmute
To check and make sure your speakers are working, just run:
speaker-test -c 2
More info in the ArchWiki.
Install Boot-loader (grub)
We are now going to install grub and configure the boot loader. In my case I have a system with BIOS (if you have UFI then check out the appropriate Arch Wiki page).
First install grub:
pacman -S grub
and then configure it by running (mind the sdx):
grub-install --target=i386-pc --recheck /dev/sdx
If you have other OSes installed, you might want grub to list them all as-well. To do that, you will need to install os-prober:
pacman -S os-prober
Once it is installed, you need to update grub:
grub-mkconfig -o /boot/grub/grub.cfg
You are almost done…! It is good at this point to enable the dhcpcd service for your ethernet, in order to have a connection after rebooting:
First find your lan interface:
ip link
Then enable the service:
systemctl enable dhcpcd@.service
And you are done! The basic installation is finished here. You can now install your favorite Desktop Environment.
Summary
In this section I will post all command-line instructions for the complete basic-install of Arch Linux, mentioned in the above sections. I will assume that you already have partitioned your hard-drive to your needs.
# Check if your Wireless Lan Interface is working ip link # Connect to your Wifi-Network and check connection to the Internet wpa_passphrase <passphrase> | wpa_supplicant -B -i <SSID> -c /dev/stdin dhcpcd ping -c 3 www.google.com # Format root and home partitions using mkfs.ext4 /dev/sdxX # Format/Enable SWAP mkswap /dev/sdaZ swapon /dev/sdaZ # Check partitions with this command lsblk /dev/sdx # Mount root and home partitions mount /dev/sdxX /mnt mkdir /mnt/home mount /dev/sdxY /mnt/home # Choose download mirror (optional) nano /etc/pacman.d/mirrorlist # Install base packages pacstrap -i /mnt base base-devel # Configure fstab (run only once!) and verify it genfstab -U -p /mnt >> /mnt/etc/fstab nano /mnt/etc/fstab # Change to your root directory arch-chroot /mnt # Language and Time Zone settings (find and un-comment) nano /etc/locale.gen locale-gen echo LANG=en_US.UTF-8 > /etc/locale.conf export LANG=en_US.UTF-8 ls /usr/share/zoneinfo/ ln -s /usr/share/zoneinfo/<zone>/ /etc/localtime hwclock --systohc --utc # Set hostname echo > /etc/hostname # Create users (create admin psswd) # useradd -m -g [initial_group] -G [additional_groups] -s [login_shell] [username] useradd -m -g users -G wheel,storage,power -s /bin/bash passwd <username> passwd # Install sudo / add user to the admin-group pacman -S sudo bash-completion EDITOR=nano visudo # and un-comment: %wheel ALL=(ALL) ALL # Enable multilib repositories: find and un-comment both lines nano /etc/pacman.conf [multilib] Include = /etc/pacman.d/mirrorlist # Add Yaourt repository (same file pacman.conf) [archlinuxfr] SigLevel = Never Server = http://repo.archlinux.fr/$arch # and install yaourt pacman -Sy yaourt customizepkg rsync # Advanced Linux Sound Architecture (ALSA) pacman -S alsa-utils pulseaudio alsa-oss alsa-lib amixer sset Master unmute # to test sound speaker-test -c 2 # Install Boot-loader (grub) pacman -S grub grub-install --target=i386-pc --recheck /dev/sdx pacman -S os-prober grub-mkconfig -o /boot/grub/grub.cfg # Enable ethernet interface service at boot (find interface with ip link) systemctl enable dhcpcd@.service
Arch Linux Install Guide – Step 2: Desktop Environment Installation
Now you are ready to install you proffered Desktop Environment! Follow Step 2 of this guide!