The Arch Linux Handbook - Learn Arch Linux For Beginners
The Arch Linux Handbook - Learn Arch Linux For Beginners
The Arch Linux Handbook - Learn Arch Linux For Beginners
org/news/how-to-install-arch-linux/
Forum Donate
1 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
For me, though, Linux is not just an operating system or a kernel. For
Learn
me, it's freedom. Thetofreedom
code — free 3,000-hour
of putting curriculum
together an operating
system according to my needs, and that's where Arch Linux comes
in.
You'll get to choose what packages you want, the kernel (yes there
are multiple), the boot-loader, the desktop environment, and so on.
In this article, I'll walk you through the entire process of installing
and con�guring Arch Linux on your machine. I'll also discuss some
common tasks and troubleshooting tips near the end.
So come with me and I'll show you how deep the rabbit hole goes.
Table of Contents
• Some Assumptions I'm Making
3 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
4 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
• Further Reading
• Conclusion
• Arch Linux
• You have a USB drive large enough (4GB) to boot Linux from
That's pretty much it. If you have all of the above, you're good to go.
5 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
How to Create a Bootable Arch
Learn to code — free 3,000-hour curriculum
Linux USB Drive
To download Arch Linux, head to https://archlinux.org/download/
and download the latest release (2022.01.01 as of this writing). The
ISO should be around 870 megabytes in size.
Once downloaded, you'll need to put it in your USB. You can use the
Fedora Media Writer program to do that. Download and install the
application on your system. Now connect your USB drive and open
the application:
Click on "Custom image" and use the �le browser to pick the
downloaded Arch Linux ISO �le.
6 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
The application will now let you pick one of your connected USB
drives. Be very careful in selecting the right one if you have multiple
USB drives connected to your machine. Now hit the "Write to Disk"
button and wait until the process is �nished.
The �rst change that you'll have to make is disabling secure boot in
your UEFI con�guration. This feature helps prevent malware
attacks during boot but it also prevents the Arch Linux installer from
booting.
The second thing that you should disable is only relevant if you're
installing Arch Linux alongside Windows. There is a Windows
feature called fast startup that reduces the boot time of your
7 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Learn
This is generally to code
a nice — free
feature 3,000-hour
to have but it curriculum
prevents any other
operating system in a dual boot con�guration from accessing the
hard disk in the process.
To disable this feature, open the start menu and search for "Choose
a power plan" as follows:
Then on the next window, click on "Choose what the power buttons
do" from the left sidebar:
8 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Then on the next window you'll see a list of "Shutdown settings" and
the "Turn on fast startup (recommended)" option should be shown
as read only there.
Click the "Change settings that are currently unavailable" at the top
9 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
and you should then be able to change the settings. Forum Donate
10 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
On my machine, hitting the F12 key during boot takes me to the list
of bootable devices. From there I can pick my bootable USB drive.
You may already know the appropriate technique for your computer
or you may have to research a bit.
Choose the �rst one from the list and wait until the Arch installer
�nishes booting up. Once fully booted up, you'll see something like
this:
11 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
That's it. That's all you'll get. Unlike other operating systems that
you maybe familiar with, the Arch installer doesn't have any
graphical user interface to automate the installation.
It rather requires you to invest your time and effort and con�gure
each part of the distribution piece by piece. It may sound daunting
but, to be honest, if you understand what you're doing, installing
Arch Linux is quite fun.
12 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
keyboard layout and a nice looking font can make the Forum
installation Donate
process a lot less frustrating.
Learn to code — free 3,000-hour curriculum
By default, the console assumes that you have a standard US
keyboard layout. This should be �ne for most people but just in case
if you happen to have a different one, you can change to that.
All the available keymaps are usually kept inside the /usr/share
/kbd/keymaps directory in the form of map.gz �les. You can see the
list of them by using the ls command:
ls /usr/share/kbd/keymaps/**/*.map.gz
13 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
You can use the loadkeys command to load the desired keymap. To
set mac-us.map.gz as default, execute the following command:
loadkeys mac-us
You can also change the console font if you don't like the default
one. Just like the keymaps, the console fonts are kept inside the
/usr/share/kbd/consolefonts which you can list out using the ls
command:
ls /usr/share/kbd/consolefonts
14 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
You can now use the setfont command for setting one of these. For
example, if you want to set the drdos8x16 as default, execute the
following command:
setfont drdos8x16
Both the loadkeys and setfont commands are part of the kbd
package containing essential Linux keyboard tools. They have great
documentation so if you'd like to learn more, feel free to check it out.
15 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
ls /sys/firmware/efi/efivars
If you're in UEFI mode then, it will list out a bunch of �les on your
screen:
In case of a BIOS boot, the efi directory won't even exist inside the
/sys/firmware directory. If you're in UEFI mode, (which you should
be if you've followed everything properly) continue to the next step.
16 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
number of bare minimum packages that you can use to install the Donate
Forum
rest of the system. So, a working internet connection is a must.
Learn to code — free 3,000-hour curriculum
If you're using a wired network then you should have a working
internet connection from the get go. To test it out, ping any of the
public addresses out there:
The live environment comes with the iwd or iNet wireless daemon
package. You can use this package to connect to a nearby wireless
network.
17 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
device list
18 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
You may think that this command will print out a list of all the
nearby networks, but that's not the case. To see the list of networks,
execute the following command:
The iwctl program will prompt you for the wi-� password. Put it in
carefully and, once connected to the network, exit the program by
19 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
This command will start outputting some output and after a few
seconds. If you do not see the command cursor show up again, try
pressing Enter. I've faced this inconvenience a few times in the past.
To begin the partitioning process, you'll have to �rst know about the
different disks connected to your computer. You can use fdisk
which is a dialog-driven program for creation and manipulation of
partition tables.
fdisk -l
20 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
So that leaves us with the /dev/sda device. Keep in mind that this
can be completely different on your machine. For example, if you
have an NVME drive, you may see /dev/nvme0n1 instead.
21 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Once you've decided which device to use, it's a good idea to check ifDonate
Forum
there are any existing partitions inside that device. To do so, you can
Learn to code — free 3,000-hour curriculum
use the following variation of the same fdisk command:
fdisk /dev/sda -l
22 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
cfdisk /dev/sda
23 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Choose gpt for your UEFI based system. Next, you'll land on the list
of partitions and free space on the device:
You can move vertically along the list of devices using your up/down
arrow keys and move horizontally along the different actions using
the left/right arrow keys.
24 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Make sure the right partition/free space is highlighted in the list and
select the [ New ] action.
Put the desired partition size. You can use M to denote megabytes,
G for gigabytes, and T for terabytes.
25 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Once you've put your desire size, press Enter to �nalize. The
Forum Donate
updated list of partitions may look as follows:
Learn to code — free 3,000-hour curriculum
26 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
From this long list of types, highlight EFI System and press Enter.
The type of the partition in the list should update accordingly:
Next is the root partition. Highlight the remaining free space and
select [ New ] once again. This time assign 10GB to this partition.
27 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
You don't need to change the type of this partition. The default
Linux filesystem will do.
Create one last partition with the remaining space and change its
type to Linux swap from the menu:
28 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
29 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
One thing that I would like to mention for those trying to install
Arch Linux alongside Windows is, in that case, the EFI system
partition should already exist in your device. So don't touch that.
Just create the other partitions and move on.
fdisk /dev/sda -l
This time you'll see the three newly created partitions with their
details:
30 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
mkfs.ext4 /dev/sda2
31 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
In the case of a swap partition, you won't mount it like the other
ones. You'll have to tell Linux to use this partition as swap explicitly.
To do so, execute the following command:
swapon /dev/sda3
32 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Learn
As you may have to codethe
guessed, — free 3,000-hour
swapon curriculum
command tells the system to
swap on this device. We'll work with the EFI system partition in a
later section. For now, mounting these two partitions will suf�ce.
reflector
This happens when the default timeout (5 seconds) is lower than the
actual time it's taking to download the information.
reflector --download-timeout 60
Going through the entire list to �nd nearby mirrors would be a pain.
That's why re�ector can do that for you.
34 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Printing out a mirror list like this is not enough. You'll have to persist
the list in the /etc/pacman.d/mirrorlist location. Pacman, the
default package manager for Arch Linux, uses this �le to learn about
35 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Before overwriting
Learn the default
to code mirror
— free list, make
3,000-hour a copy of it:
curriculum
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
This command will generate the mirror list and overwrite the
default one. Now you're ready to install the base Arch Linux system.
pacman -Sy
Once the update process is �nished, you can use the pacstrap
36 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Once the update process is �nished, you can use the pacstrap
Forum Donate
script to install the Arch Linux system. Execute the following
command to start
Learnthe
to installation process: curriculum
code — free 3,000-hour
pacstrap /mnt base base-devel linux linux-firmware sudo nano ntfs-3g networkmana
37 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
considering you'll need the other ones anyway, why not catch 'em all
Forum Donate
in one go.
Learn to code — free 3,000-hour curriculum
Depending on your internet connection, the installation process
may take a while. Sit back and relax until pacstrap does its thing.
Once it's done, you'll see something as follows:
38 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
How To Generate the Fstab File
Learn to code — free 3,000-hour curriculum
According to the ArchWiki,
The genfstab program can detect all the current mounts below a
given mount point and print them in fstab-compatible format to
standard output. So genfstab -U /mnt will output all current
mounts under the /mnt mount point. We can save that output to
the /mnt/etc/fstab �le using the >> operator.
39 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
ls /usr/share/zoneinfo
40 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
I live in Dhaka, Bangladesh which resides inside the Asia zone. If I list
out the content of Asia, I should see Dhaka there:
41 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
nano /etc/locale.gen
42 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum
You'll have to uncomment the languages that you want to enable. I Donate
usually only need English
Learn and
to code Bengali.
— free So I'll locate
3,000-hour the en_US.UTF-8
curriculum
UTF-8 , bn_BD UTF-8 , and bn_IN UTF-8 languages. Save the �le by
pressing Ctrl + O and exit nano by pressing the Ctrl + X key
combination.
locale-gen
43 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum
Now that you've enabled multiple languages, you'll have Donate
to tell Arch
Linux which one to use
Learn by default.
to code To do so, open
— free 3,000-hour the
curriculum
/etc/locale.conf �le and add the following line to it:
LANG=en_US.UTF-8
That's all you gotta do to con�gure your locale. You can always go
back to the /etc/locale.gen �le and add or remove languages from
it. Just remember to run locale-gen whenever you do that.
Apart from the locales, if you've made any changes to your console
keymaps in the �rst step of installation, you may want to persist
them now. To do so, open the /etc/vconsole.conf �le and add your
preferred keymaps there.
KEYMAP=mac-us
Now every time you use the virtual console, it'll have the correct
keymap and you will not have to con�gure it every time.
44 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
pacman -S networkmanager
Open the �le with nano and write your host name in it. You can use
anything to identify your machine. I usually use my device brand or
model as my hostname and as I'm on a legion laptop, I'll simply write
the following:
legion
But some software may still read the /etc/hosts �le directly. Open
the �le in nano and add the following lines to it:
127.0.0.1 localhost
::1 localhost
45 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
127.0.1.1 legion
Forum Donate
pacman -S networkmanager
passwd
The passwd command lets you change the password for a user. By
default it affects the current user's password which is the root
46 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
The useradd command lets you create a new user. Make sure to
replace my name with the one you want to use. The -m option
indicates that you also want it to create the corresponding home
directory. The -G option will add the new user to the wheel group
which is the administration user group in Arch Linux.
Now you can use the passwd command once again to set the
password for the newly created user:
passwd farhan
The program will prompt you for a new password and a password
con�rmation. Again, don't forget to replace my name with the one
you've used.
Finally, you'll have to enable sudo privilege for this new user. To do
47 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
This �le essentially means that all users in the wheel group can use
sudo by providing their password. Save the �le by hitting Ctrl + O
and exit nano by hitting Ctrl + X. Now the new user will be able to
use sudo when necessary.
48 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
pacman -S os-prober
Now, you'll have to mount the EFI system partition you created a
few sections ago. To do so, you'll have to �rst create an efi
directory:
mkdir /boot/efi
According to Wikipedia,
50 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum
I hope you remember that we formatted the /dev/sda1 device as Donate
the EFI systemLearn
partition during
to code the
— free partitioning
3,000-hour phase. Make sure to
curriculum
use the correct one for your device.
You can more or less use this command verbatim. You can change
the --bootloader-id to something more expressive like arch or
something else. If the installation �nishes without any errors, you'll
then have to generate the GRUB con�guration �le.
51 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
If you're installing
Learnalongside
to code —other operatingcurriculum
free 3,000-hour systems, you'll have to
enable os-prober before generating the con�guration �le. To do so,
open the /etc/default/grub �le in nano text editor. Locate the
following line and uncomment it:
#GRUB_DISABLE_OS_PROBER=false
This should be the last line in the aforementioned �le so just scroll to
the bottom and uncomment it.
52 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
The command will also take into account the microcode you
installed earlier and any other existing operating system on your
machine.
53 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
pacman -S xorg-server
Wait until the installation is done and then move on to installing the
necessary graphics drivers.
54 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
pacman -S gnome
55 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
systemctl enable gdmcode — free 3,000-hour curriculum
Learn to
56 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
systemctl
Forum Donate
exit
Next, unmount the root partition to make sure there are no pending
operations:
umount -R /mnt
reboot
57 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Choose Arch Linux from the list and wait until the system �nishes
booting up.
58 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
59 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
As you can see, I'm currently using Plasma. Now switch to TTY2
press Ctrl + Alt + F2 key combination. You'll see a console login
prompt:
60 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Login with the root credentials and disable the sddm display
manager.
pacman -S gnome
61 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
systemctl enable gdm
Learn to code — free 3,000-hour curriculum
reboot
62 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
63 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
How To Install Packages Using Pacman
Learn to code — free 3,000-hour curriculum
To install a package using pacman, you can use the following
command syntax:
You can also specify the repository you want to install the package
from like this:
64 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
This will remove the package but will leave the dependencies. You
can remove the package with dependencies if they're not required
by any other package by executing the following command:
65 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
66 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
This will print out all the packages found in the database with that
Learn to code — free 3,000-hour curriculum
search term and will also indicate if any of those are already
installed.
This is useful when you want to uninstall a package but do not know
its exact name.
AUR is one of the most attractive features of Arch Linux. It's due to
AUR that Arch Linux has a package count almost equal to Debian.
You've already used pacman to install various packages. Sadly, you
can not use that to install packages from AUR.
67 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
You'll have to install one of the AUR helpers instead. Arch Linux
Forum Donate
doesn't support any of these helpers and advises you to learn how to
Learn to code — free 3,000-hour curriculum
build packages manually. I'll explain both techniques here. If you
understand how a helper works, you'll be able to do it manually as
well.
You can not install yay like other packages. You'll have to get the
source code and compile the program. You'll need git and the
base-devel package to do so. Assuming you've already installed
base-devel during Arch Linux installation:
pacman -S git
makepkg -si
68 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
After the build process �nishes, makepkg will ask for installation
con�rmation and your password. Input your password carefully and
let the installation �nish.
yay --version
Now let's install something using yay. One of the common packages
you may want to install is the visual-studio-code-bin package. To do
so, execute the following command:
yay -S visual-studio-code-bin
Unlike pacman, you shouldn't run yay with sudo. Yay will look for the
given package and will ask whether you would like to see the diff or
not:
69 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
All the repositories over at AUR comes with a PKGBUILD �le which
contains the instructions for building this package. Yay has this nice
feature where it shows you what has changed in the PKGBUILD �le
since the last time.
For now, I'll pick N for none and hit enter. Yay will now look for the
dependencies and ask for your password to install them.
70 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Con�rm the installation and provide your password. Yay will then
install the dependencies and start building the package. Once built,
yay will install the package and prompt for your password where
necessary.
After the installation �nishes, search for Visual Studio Code in the
application launcher:
71 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Congratulations on installing your �rst package from AUR. Yay
Learn to code — free 3,000-hour curriculum
commands are almost identical to pacman, so if you can do
something with pacman, you should be able to do that with yay as
well.
In fact, yay can also install packages from of�cial Arch Linux
repositories like pacman. But I would suggest you to use yay only for
installing packages from AUR when necessary and pacman for
everything else.
Make sure you have git and base-devel packages installed. If not,
use pacman to install them.
For the demonstration, let's install Spotify this time. First visit the
AUR page for the spotify package - https://aur.archlinux.org
/packages/spotify/ and copy the "Git Clone URL" from there.
72 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
The page even lists all the dependencies you'll need. Clone the
repository to your machine:
73 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Make sure there's nothing harmful in the �le. Once you're satis�ed,
use makepkg to install any dependencies, build the package, and
install it. Ideally there shouldn't be any issues but sometimes, things
can take an unexpected turn.
74 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Turns out the package requires you to add the Spotify for Linux gpg
key to the user kyechain. This command downloads the gpg key
using curl and pipes it as the input of the gpg --import command:
75 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
76 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
• r/archlinux
For the most part, the wiki should have the information you're
looking for. In fact, if you're on a laptop and having dif�culty getting
something to work, there is an entire wiki category dedicated to
different laptops. So look around the wiki.
If the wiki fails to solve your problem, then ask other fellow users at
the forum as well as the subreddit. But whenever you're doing that,
make sure to do your research �rst and include as much description
as you can in the post. It's really annoying if other users have to keep
asking you for more information and it'll also lower the chance that
you'll get an answer.
In those cases, you can use your live USB drive as a rescue media. To
do so, reconnect the bootable USB to your computer and boot into
the live environment. Once there, con�gure the time, keymaps, and
77 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Learn
Then use fdisk to code
to list — free
out all your3,000-hour
partitionscurriculum
and locate the one
holding your Arch Linux installation. In my case it's the /dev/sda2
partition. Mount the partition like you did before:
arch-chroot /mnt
exit
umount -R /mnt
reboot
Further Reading
If you've come this far then you've done a lot of reading already –
78 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
If you've come this far then you've done a lot of reading already –
Forum Donate
but that's not all. This entire handbook was written by combining
Learn
information from thetowiki,
codeforum,
— free 3,000-hour curriculum
and subreddit. I'm listing out some
wiki pages that I think you should read.
• Installation guide
• Network con�guration
• General recommendation
• Desktop environment
• pacman
• makepkg
• List of applications
Couldn't think of any more at the moment but I'll keep this list
updated.
Conclusion
I would like to thank you from the bottom of my heart for the time
you've spent on reading this article. I hope you've enjoyed your time
and have learned a lot about not only Arch but Linux in general
79 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
If you've enjoyed my writing and want to keep me motivated,
consider leaving starts
Learn on GitHub
to code and endorse
— free 3,000-hour me for relevant skills
curriculum
on LinkedIn.
If you read this far, tweet to the author to show them you care.
Tweet a thanks
ADVERTISEMENT
80 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Forum Donate
Our mission: to help people learn to code for free. We accomplish this by creating thousands of
videos, articles, and interactive coding lessons - all freely available to the public. We also have
thousands of freeCodeCamp study groups around the world.
Donations to freeCodeCamp go toward our education initiatives, and help pay for servers,
services, and staff.
Trending Guides
81 of 82 3/12/23, 15:04
The Arch Linux Handbook – Learn Arch Linux for Beginners https://www.freecodecamp.org/news/how-to-install-arch-linux/
Our Charity
About Alumni Network Open Source Shop Support Sponsors Academic Honesty
82 of 82 3/12/23, 15:04