Arch Linux Installation Guide 2020

DistroTube
233 followers
Oct 25, 2024
have you ever wanted to install arch
linux but maybe you were a little afraid
because you've heard these horror
stories
you know a lot of people like to over
blow arch linux as far as the difficulty
of the installation process it's really
quite easy to install
some people i think mistakenly think it
takes a long time to install arch linux
it's actually
very quick to install arch linux so
today i'm going to run through
an arch installation i'm going to do
this inside a virtual machine
i'm going to install arch linux inside
virtualbox and if you're new
to installing arch linux or new to
installing
any linux using a command line installer
i would suggest
you also do it in a virtual machine
before trying it on physical hardware
what i want you to do is install
virtualbox and follow along with me
and i promise you at the end of this
video both you and i will have working
arch
installations inside virtualbox so the
first thing we need to do of course
is create a virtual machine inside
virtualbox i'm going to go to the menu
here
that says machine i'm going to click on
new and i'm going to title this virtual
machine
arch linux and by the title it's already
figured out
that the os type is linux and the
version is arch linux 64 bit
if i needed to i could go through the
drop down menu and select something
else but this is correct in my case so
i'm going to click next
now let's give it some ram i'm going to
give my vm
four gigs of ram the amount of ram you
give your vm well of course depend on
how much ram your host machine has
how much ram you can spare i've got 64
gigs of ram on my host machine so
i can give this vm as much ram as i want
but four gigs is more than enough for
what we're doing
then create a virtual hard disk now just
leave it on default
vdi as the disk image is fine just click
next
dynamically allocated for the hard disk
that is fine click next
and then let's choose a virtual hard
disk size i'm going to give this virtual
machine
a 20 gigabyte disk and i'm going to
create
and create one more time all right and
we have created that vm
now click on the new vm that we just
created go to settings
and in settings what i want to do is i
want to go to system i want to give
the processor more than one cpu i'm
going to give it two cpus you see i have
up to 24 available on my machine your
machine
may have a different number of cpus
available but i want to beef it up
just a little bit so i'm going to give
it a little more power i'm also going to
enable efi because the last time i did
an arch installation video i
did bios and a lot of people wanted a
efi
installation so today let's run through
an efi
installation of arch and i'm going to go
to display
video memory the max you can give
virtualbox at least in the gui
is 128 megs give it 128 megs max it out
and then i'm going to enable 3d
acceleration even though i don't think
we're ever going to boot into a
graphical environment for this video
then i'm going to go to storage and i'm
going to click on the little optical
disk here
and we are going to add our arch linux
iso so i downloaded the latest iso
and it appears there i'm not going to
change anything with audio
or network uh matter of fact the only
other thing i'm going to do is i'm going
to go down to user interface and this is
just for me not for you guys
i'm going to click off the menus and the
bottom systray
that the windows have just because i'm
recording these windows and i want them
to be
as clutter free as possible and i'll
click ok
i'm going to go ahead and launch my new
vm
all right and we get to a command prompt
and we need to read the installation
guide especially if you've never done
this
what you need to do is go to the
archwiki and
on the main page of the archwiki there
will be a link to the installation guide
this installation guide is not very long
you could page down two or three times
and be at the end of the installation
guide it's not a very lengthy process
matter of fact
more than half the guide is probably
stuff that won't even apply to us
so really it's a very short and quick
installation
so the very first thing we need to do is
set our key map now by default the key
map is set for
us but if you were unsure about the key
map what you would do is you would go in
here
and you would run this command ls
meaning list all the contents of this
directory
and what do we want to run ls on we want
to run it on this directory slash user
slash share
slash kbd slash key maps
and then slash two asterix
slash one more asterisks dot
map dot gz and if you run that
it will list out all the available key
maps
that are possible for you to choose
matter of fact what i would do is i
would actually
pipe that through list so i would run
that same command and then at the end
add a pipe symbol and then the less
command
so that you can just hit enter and
scroll the entire list
makes it a lot easier to to find what
you need
for me though like i said the us key map
is the default so i actually
don't need to set anything but those of
you that do you would then run this
command load
keys space and then the key map that you
found so if you were
german for example you would load d e
latin one for the german key map let me
clear the screen
the next thing we need to do is make
sure we have working internet because we
don't have internet
then nothing's going to work so let's go
ahead and do a ping
google.com and let's see if we actually
have a ping
it doesn't look like we do oh there it
goes it's just really really slow
really really slow there it goes all
right it took a second but now it's
working
as expected all right control c kills
the ping so we do have network
next we need to make sure our system
clock is accurate so we need to run the
following command
time date ctl all one word time date ctl
space set dash ntp space
true run that command and if everything
worked right you can verify
it with time date ctl space status
and yeah it's active everything worked
just fine with that
the next thing we need to do is we need
to partition our disk now this
is probably the most critical part of
the installation
so this is the part where you can mess
some stuff up but
the archwiki suggests that we use fdisk
to partition our drives i'm not very
familiar with fdisk i've used it a
little bit in the past typically i do
cf disk when i do my partitioning but
for purposes of this video i'll actually
do the f disk
so i'm going to run f disk space dash
l and this will list all of
our drives that are available for us to
use here now there are two drives here
instead of just one even though i
created one drive for the vm
the second drive here is just the
loopback device
it's really just associated for the live
environment that we booted into
but really our device is that top one
the 20 gig
hard disk that i created at slash dev
sda so now let's run fdisk
slash dev slash sda and
now it's asking for more commands we
have a prompt i don't know a lot of the
commands
but you can type m for help so i'm going
to type m for help
and the first thing we need to do is
create a new label
and we need to either do o on the
keyboard
for a dos partition table or g or a gpt
partition table so since i'm doing efi
we should do gpt so i'm going to type g
to create a
gpt partition table all right now that
we've done that again
i'm not sure what command i want to type
next i'm going to do m
for the help again and i think what we
need to do
at this point is we need to add a
partition to that disk
and to add a new partition we need to do
in so type in hit enter
it's going to ask us partition number
one through 128 because
using efi you can have up to 128
partitions on a disk
that's insane you have to be a complete
nutter to have 128 partitions on a disk
but all right what's the partition we're
doing here and we'll do
partition one then it's asking what is
the first sector by default
it's at 2048 i would just go with the
default
and then the last sector what you need
to do here is give it a byte size for
the last sector or just give it the plus
symbol
plus a size and i'm going to do plus
550 m 550 megabytes
because that is going to be our efi
partition and it needs to be
550 megabytes all right created new
partition one
and it created it as a type linux file
system
that's not the correct type for that
partition but we will change it later
for now
let's keep going because we need three
partitions we just created the efi
partition i'm also going to create a
swap so
in on the keyboard for add new partition
partition number
this will be partition 2 first sector
just leave it as default it's going to
be the end of the last sector
and then the last sector for this
partition again we'll give it a size i'm
going to do plus
and since a swap that i'm creating here
i'm going to do two gigs
in this vm so plus 2g all right and it
created
new partition 2 and it also created it
as type
linux file system that's not correct
we'll change it in a minute
but let's add that third partition so n
for add another partition
partition three first sector just hit
enter
and then the last sector i'm just gonna
hit enter and it's gonna by default give
it
the remaining space and it created
partition 3 of linux file system
that's will be the correct type for this
one
size 17.5 gigabytes because that was all
the remaining space
after the 550 megabyte efi partition and
the two gigabyte
swap partition so i'm going to hit m on
the keyboard again
and to change a partition type you need
to hit t on the keyboard so t
which partition do we need to change the
type of well let's start with partition
one
and partition type or alias i'm not sure
what we want to choose out of the list
it says type capital l to list
everything so
let's do l and it looks like the very
first one you see number one
is efi system that's what we want so q
to quit
out of that and then i'm gonna type one
for efi system
and it changed that partition to from
linux file system
over to efi system perfect now i'm gonna
type t
on the keyboard again for change
partition type and now we need to do
partition 2
and partition 2 let me do l to get the
list
partition 2 needs to be linux swap which
linux swap
is number 19 in the list q to get out of
that and then type
19 and it changed partition 2 from linux
file system
to linux swap and then partition 3
is also set to linux file system i don't
need to change that because that's going
to be our
system file system right that's going to
be the big partition
and it needs to be linux file system so
i think we're done here
i think what we need to do now is write
the table to the disk so let me hit
m here and it looks like we need to type
w
to actually write the table and then it
automatically exits out of f
disk for us now we need to go ahead and
make our file system
so we need to make three different file
systems on those three different
partitions that we did
now we did the efi partition it needs to
be
fat32 so we need to do mkfs dot
fat space dash f
32 capital f 32 actually space slash
dev slash sda1
alright so we made the fat32 file system
on sda1
now sda2 is the swap so let's do
mk swap all one word make swap
space slash dev slash sda2
we just made the swap we need to turn
the swap on
so do swap on all one word space
slash dev sda2 all right and finally we
need to make the file system on the big
partition on sda3
so let's do a make file system mkfs
dot extend 4 ext4
space slash dev sda3
and we have made our file systems now we
need to mount
the big partition sda3 so let's do a
mount
space slash dev sd sda3
space mnt and now that that is mounted
over onto the live image
what we need to do is run the pack strap
command this actually
installs the base system for arch so run
pack strap all one word space slash m
t because that's where we're mounted to
space and then what we
are installing we're going to install
base which is the base arch system we
also are going to install
linux which is the kernel and also
install
linux dash firmware hit
enter and this is installing
the base package this usually takes just
a couple of minutes i'll pause the
recording
and then according to the wiki we need
to go ahead and generate
our file system table our fs tab or our
f-stab and however you want to pronounce
it so let me clear the screen here
and then i'm going to run this command
gen
f stab space dash capital u
space slash m t space and then
two greater than signs so two of the
right pointing chevrons
space and then slash m t slash
etsy slash fstab
and hit enter and that should have
generated our file system table
then the next thing we need to do is go
ahead and run
arch dash charu so a charute
is changing into the root directory of
our new
installation is basically what that is
and of course i messed that up because i
didn't tell it where we were
rooting to i want to do arch dash to
root space
m t because that's the mount point all
right you see the prompt changed we are
now logged in as
root you know over at slash mnt on sda3
because that's where we're going to be
installing everything on the sda3
partition
now we need to go ahead and set our time
zone and how you do that
is you run this command ln for link dash
sf space and then this path
slash user slash share slash
zone info slash
region and this is not actually region
but it is the name of your region slash
city again that's the name of your city
and then space
and then slash etsy slash local time
now i actually know my region and city
because i've done these installs so many
times
my region is america slash and then the
city is chicago i don't actually live in
chicago i'm nowhere near chicago but
we're in the same time zone
so that's what i would need to run i'm
going to go ahead and run that
now you may not know exactly what your
region or city is
so what i would do is i would run this
command here
ls for listing the contents of our
directory
slash user slash share slash zone info
and what you see in this directory those
are the regions
and once you find your region for
example europe
what i would do is then ls user slash
slash zone info slash europe
and those are the cities and then
hopefully
you you know your region and city so you
just go back
and you know plug in what you needed to
do for that ln command the link command
and a control c to cancel that clear the
screen
the next thing we want to do is set our
hardware clock you run this command
hw clock space dash dash
c s-y-s-t-o-h-c that command that sets
our
system clock and then the next thing we
need to do is set the locale
now this is a little tricky uh is you
you can mess this up and the archwiki
and on this if you guys are following
along in the archwiki
it is a little confusing here what you
need to do it says you need to edit
the locale.gen and uncomment
your particular locale so what they're
saying is whatever editor you use for
example
nano space slash etsy slash
locale dot gen let's hit enter nano is
not found because it's not part of the
base packages that were installed
earlier so let's do a pac-man
space dash s space nano
let's go ahead and install that neither
nano or vim were going to be installed
by default you have to install those
the only thing i think that's here by
default is vi nobody really cares to use
vi
most of you guys probably are not film
users either i think nano is
be a little easier so i'm going to use
that throughout this tutorial
so now let me run the nano space slash
etsy slash locale dot gen
all right and you see this file it has a
whole bunch of lines and every line is
commented
go find your locale and uncomment that
line for me
i need to find the line en underscore us
english us
so i'm going to go through the list and
i want this line right here
en underscore us.utf-8
space utf-8 okay now i'm going to do
control
x in nano to exit y for yes to write it
hit enter and then the next thing you
need to do after editing that file
is run this command locale dash
gen it's generating locales
generation complete now you can
uncomment more than one locale if needed
for me
english us is all i need the next thing
we need to do is set the host name
so what i'm gonna do is i'm gonna do
nano again space slash
etsy slash host name we need to create
this config file
and then we just need to type the
hostname the hostname is the hostname of
the computer
and in this case i'm going to call this
vm arch
vbox makes sense to me so control
x to exit y to save
that set the host name and then we need
to create
a host file so i need to once again nano
space slash etsy space slash hosts
and this file is not empty there are two
lines but they're commented out
but we need to add some lines ourselves
the archwiki
actually tells you exactly which lines
to add these three lines here that i've
highlighted
and just copy it exactly the way it you
read it from the wiki so it says to do
127.0.0.1
and then tab over or space over a few
times and then do
local host and then the second line
needs to be colon colon1
and then the same thing tab over space
over and then once again
localhost and then on the third and
final line 127.0.1.1
tab over space over and then do my
hostname and this needs to be
your actual host name that you just
created in the host name file so
in my case arch v box dot
local domain and then tab over space
over
and then do your host name again which
is arch
v box for me and of course it'll be
different for you
control x y to save and
clear the screen the next thing we need
to do is
create some users and some passwords
because by default there's only going to
be
one user on the system the root user
unless you create other users also
you need to set a password for your root
user if you forget that
then at the end of the installation
you're gonna have to just root back into
this thing and do this later you might
as well do it now
so run the command as root pass wd
that's going to ask for your new root
password create it
confirm it all right now let's add a
normal user a non-root user so i'm going
to run the command user add
it's all one word and then dash m
and then space and then the name of that
user i'm adding i'm going to call this
new user
dt then we need to create a password for
the dt user
pass wd space dt then create
that password then confirm that password
all right and then the last thing we
need to do here really is to make sure
that dt
is a member of some groups especially
the wheel group
which would give him pseudo privileges
that way you don't have to log in as
root to do things as root you know you
can do
sudo you know as the dt user in my case
or whatever username you created
so i'm going to do this command user mod
space dash lowercase a capital g
space and then i'm going to list out
some groups i'm going to do the wheel
group
comma audio comma video
comma those are the most important but
you can keep adding groups some of the
other groups that are available would be
optical storage as a virtual box user
i'll eventually add dt to the vbox users
group
if i use vert manager i'm going to need
to add dt to the lib
group you know but for now i'm just
going to stick with these
so i'm going to hit enter and complain
because i wasn't through with that
command
you need to do user mod dash lowercase a
capital g
all those groups with no spaces between
the commas and then
space and then the user you're adding to
all these groups
in my case dt now hit enter again
okay no errors now we wanted to add dt
to the wheel group so he had sudo
privileges but sudo
is not installed unless we install it
let's go ahead and do a pacman
dash capital s sudo
and install sudo and now that we've
installed sudo
we can run the command vi sudo to edit
the sudoers file and make sure
dt has those privileges now vi sudo
is going to edit that file as vi if you
don't want to edit nvi
and i don't want to edit nvi do this
editor
all caps equals nano or whatever editor
you want to use here in the command line
but editor equals nano space
vi sudo and now we can edit this
sudoers fall we need to find one line in
here we need to find a line
about the wheel group and it's right
there uncomment that
you see that it says will all equals all
equals all means the wheel group
has all privileges they can do anything
and by my dt user being a member of the
wheel group
he has super user privileges so he can
do anything so control x to exit
y to save next let's go ahead and
install grub
so let's do a pacman dash capital s grub
and y for yes now that we have grub
installed um since we're doing efi
other than grub there's some things we
need alongside grub we also should do a
pacman dash capital s
efi boot manager mgr
so efi boot mgr all one word we also
need
dos fs tools we also need os
dash prober and then we need m
tools hit enter install all of those
packages
and then we need to make a efi directory
in our boot directory so we need to run
this command
mkdir make directory space
slash boot slash and this is the
directory we're creating efi
all caps hit enter then we need to mount
our efi
partition so mount space slash dev slash
sda1 remember was the efi partition
space and then where are we mounting it
to we're going to mount it to of course
boot slash efi all right that is mounted
now let's run the grub install command
because
just sudo pacman s grub
it installs grub but it doesn't really
install grub
to a proper partition because it doesn't
know where to put it you actually have
to then
run this command grub dash install and
since we did
efi we're going to have to add some
flags here
so do grub dash install space dash dash
target equals x86 underscore
64 dash efi
space and then dash dash boot loader
dash id equals grub underscore
uefi space dash dash
recheck hit enter it says installing
installation finish no error reported
okay so it installed grub
we still need to make a grub
configuration file
now this is easy we don't have to edit
anything by hand just run this command
here
grub dash mk config
space dash o space slash
boot slash grub slash
grub dot cfg it generates the grub
configuration file
and that is it at this point we've
really installed arch linux the base
system we could actually
reboot the system right now but before
you do you may want to install some
other stuff while you're already
here and mounted onto sda3 what i would
do
is for networking usually people install
network manager before you reboot
because
chances are you'll most likely have
internet
if you install network manager now than
waiting till later
so we could do a pacman dash capital s
network manager space and then is there
anything else i want to install
for me i use vim as my editor i could go
ahead
and install that that way i don't have
to keep using nano
you could go ahead and install you know
window manager
and all that stuff xor and all that
stuff will take some time you're going
to have to configure some stuff too
i'm not going to take the trouble of
getting into the graphical environment
stuff
let's just stick with this for now so
i'm going to just install network
manager and install vm
i don't think git is installed by
default i would like to have git
too so i'm going to go ahead and pac man
dash capital s get just to make sure i
have get installed on the system
really i think that's enough for a base
install since we installed network
manager we probably should enable it
with
a system d so let's go ahead and run a
system ctl
space enable space network
with a capital n network with a capital
n manager with a capital m
and created that sim link and really
let's go ahead and exit
out of the your root and reboot so let's
exit
type exit all right and then we're still
mounted
here so run u-mount for unmount u-mount
space slash mnt says target is
busy do an up arrow to get that command
to come back up and add
a dash f flag so u mount space dash
f slash mount we're going to force it
done mount target is busy
maybe f wasn't the right flag i think
there is a l flag for a lazy
flag let's see okay the l flag u mount
space dash
l space slash mnt will force
the unmount all right now that we have
got out of the true
and we've unmounted now we could type
reboot and reboot into our freshly
installed arch
since i'm in a vm don't reboot i
actually
am going to do shutdown run
shutdown now sudo shutdown now or halt
now or whatever
command you want to run to shut down the
system the reason we need to shut down
instead of reboot
is because i need to go back into the
settings of the vm
because remember the iso is still
attached so
just rebooting won't work it's just
going to reboot us back into the live
environment so go to storage
click on the iso and then go down to
this disk with the
red x on it click on it and it's going
to say remove
selected storage yeah click ok
now that we've detached that iso now
restart
all right we've gotten to a command
prompt you see it says arch vbox
login so that's the hostname of the
computer and
we created the dt user of course we
could log in as root as well but i'm
going to login as dt
let's see if we have networking so if i
do a ping
google.com we have network and we have
internet we can do anything
so that's really it i mean we just did a
base arch install i don't know how long
that took
i rushed through a lot of that from here
you just pac-man dash capital s
all of your stuff xor your login manager
your desktop environment your window
managers
and your various applications your
graphical applications
and some of that stuff can take a while
especially if you're not exactly sure
what you want to install
what most people do that run things like
arch linux or gen 2 and things like that
they keep an install script they just
keep a list of programs they always need
that way when they reinstall they can
just plug that script in
and it just installs all that stuff for
you so that is it for this arch linux
installation guide again you know
practice in a vm
just follow along with me in a vm maybe
install it in a vm half a dozen times to
really get comfortable using the command
line and editing things using things
like nano and reading the wiki
and if you run into some errors reading
the wiki figuring out the solutions
once you've done it half a dozen times
you know install it on physical hardware
if you have a spare machine that would
be best but if you don't have a spare
machine after you've played around with
it a little bit in a vm
and then maybe go ahead and roll the
dice and install it on your main
production machine
arch linux is not that advanced right
if you know a little bit about linux if
you've used linux
a few months then i think you can get
through an arch linux installation
and i think you can maintain the system
now before i go i need to thank a few
special people
i need to thank the producers of the
show michael gabe corbinian mitchell
devin fran chuck claudio donnie dylan
george kell of devils louis paul scott
and willie they are my highest tiered
patrons over on patreon without these
guys
this 2020 version of the arch linux
installation guide wouldn't be possible
the show is also brought to you by each
and every one of these ladies and
gentlemen these are all my supporters
over on patreon because this channel is
supported by you guys the community
there are no corporate sponsors here at
distrotube it's just me
and you you want to support my work look
for distrotube over on patreon peace
