Your support is very much appreciated. Thanks, guys!
AI Generated·May contain errors
Arch Linux is one of the most popular Linux distributions out there. It's also one of
the quickest and easiest to install. Today, I'm going to run through a traditional Arch Linux
installation using the command line install process. I'm going to install Arch Linux. I'm
going to install the base packages, the Linux kernel. I'm going to install the Neri window
manager, which is a Wayland compositor, so it's going to pull in Wayland for the display server.
We're going to partition the drive. I'm going to use ButterFS as our file system,
and I'm going to use ZRAM for a swap. I'm going to show you how to do all of that,
and this installation process is going to take 15 minutes or less, so go ahead and set a timer.
The first thing you need to do is you need to go get the ISO for Arch Linux. Go to archlinux.org
and click on the download page here, and then on the download page, there's a couple of different
methods to go and get the ISO. You can get it through a torrent, or you can just do a direct
download from several mirrors here. I've already downloaded the ISO, so I'm going to go ahead and
install Arch Linux. I'm going to run through an installation inside a virtual machine,
but the installation process is very similar whether it's a physical machine or a virtual
machine, so I'm going to open vert manager. That's what I use for my virtual machines,
and I'm going to go ahead and create a virtual machine. Let's browse my local downloads directory
for the Arch Linux ISO. There it is, and it has detected that that ISO is in fact Arch Linux. I'm
I'll give it two cores of my 24 core CPU, and then 20 gigs of disk space is fine, and I will name this
archlinux-install, and then I'm going to click finish here, and away we go. Let's go ahead and
make this full screen, and now we come to the command prompt. Now because I'm doing this on
camera, and I know you guys are going to have a problem reading the text, I'm going to go ahead
and change the font size here in the tty. So I'm going to run the command set font space,
and then this particular font tr-v32b makes us a much bigger font now. First thing you need to do
is ensure your system clock is accurate by syncing it with network time servers, and you use this
command here time-datectl set-ntp to true. Next we need to partition our drive, and I'm going to use
this particular program here. I'm going to go ahead and use a cfdisk. Cfdisk is capable of
doing both GPT and DOS partition tables, so UEFI and legacy BIOS. We're going to do UEFI today
because I think that's what almost everybody is on these days. So we need to choose a GPT label,
and then free space. Now the first thing we need to do is we need to create a EFI system partition,
and it needs to be about 512 megabytes. So I'm going to click on new partition. It needs to be
512m for 512 megabytes. Hit enter, and the partition type by default, it defaults to
Linux file system. We need to change that, so I'm going to move over to type, and I'm going to move
up in the menu to EFI system, and now we've got that, and then arrow down the free space that's
available. I'm going to make a new partition. I'm going to give the partition all of the available
space that's remaining, and then the type Linux file system is correct. So let's go ahead, and
I'm going to move over to write. Let me actually move my head out of the way. We need to write,
and it's going to ask you to confirm it by typing the full word yes, and then after that you hit
quit, and you're back at the command line. Next we need to make the file systems. So the EFI
partition needs to be a FAT32 file system. So let's MKFS for make file system dot FAT, and then
dash capital F32 for FAT32 slash dev slash, in this case, I know it's going to be VDA1 in my
virtual machine for the partition. Now for you, you may need to figure out what the partition is.
You could do a LSBOK and find out what the partitions, but this virtual machine always
creates them as VDA1, VDA2. So for me, MKFS dot FAT dash capital F32, and then slash dev slash
VDA1, and that creates the FAT32 EFI partition, and then I'm going to up arrow, and I'm going to
run this command make file system dot BTRFS. So we're going to make a butter FS partition. We're
going to give it this flag dash L. We're going to give it a label arch root, and then the device is
slash dev slash VDA2. In this case, it's the second partition, and that made our butter FS
partition. But since we chose butter FS, butter FS, you typically want to set up with sub volumes.
You want to be able to create snapshots at some point. So let's go ahead and take care of all of
that. So I'm going to mount my butter FS partition, which in my case is slash dev slash VDA2, and I'm
going to mount it to slash MNT. And then next I'm going to do this command here, butter FS space
sub volume create, and then slash MNT slash, and then the at symbol. Next, I'm going to hit the
up arrow key here and rerun this command. This time I'm going to create slash MNT at home, and
then I'm going to up arrow, and this time create a slash MNT at snapshots, and then one more time
up arrow, and this time MNT slash at bar underscore log. Now we need to go ahead and unmount. So do
a U mount space and then slash MNT to unmount. And then we're going to mount again. We had to
unmount to mount again, because now we need to mount them properly after creating the sub volume.
So we're going to mount dash O, and then we're going to give it a bunch of flags. No at time,
comma, no spaces between this. Compress equals ZSZSTD, and then comma, and then sub ball equals
at, and then a space slash dev slash GDA2 is my butter FS partition space slash MNT. That's where
we're going to mount it to. Next, we want to create some directories. So I'm going to make
gear dash P. So we're going to create these directories and all the parent directories if
needed, and we need to make slash MNT. So mount slash, and then we're going to do this inside
braces because this will be a brace expansion. We're going to create several directories. We're
going to create a mount slash boot, comma, slash home, comma, dot snapshots, comma, and then finally
var slash log. And if I did that correctly, let's go ahead and list slash MNT to see if those
directories exist. They do. And now we need to mount all of those directories we just created,
and there were four of them. So I'm going to up arrow a couple of times until I get,
remember this command here where we mounted a VDA2 to slash mount. Well, now what we need to
do is we're going to rerun a similar command. Let me scroll over sub volume at needs to be at home.
So this time we're going to do at home and then slash MNT slash home. And let me hit enter on
that. I'm going to up arrow, and now we need to do the snapshots. So this will be at snapshots
because that was the mount point we created. And then the mount point is slash MNT slash
dot snapshots was the directory we created. And then up arrow and the next sub volume
that we need to take care of here is var underscore log. And then that mount point
is at slash MNT slash var slash log. And then finally let's mount slash dev slash VDA1,
which is our EFI partition that needs to be mounted at our newly created slash mount slash
boot. Now we can verify all of this for the LSBOK dash F, and that gives us our file system. Of
course I'm zoomed in, so it may be kind of hard to read. Another command you could do here is
butter FS sub volume space list, and then slash MNT. And there are our sub volumes there. And
that really is the most complicated part is setting up the partitions and the sub volumes
for butter FS. Let's go ahead and do a quick base install. Now I'm already mounted into VDA2
slash MNT, so let's go ahead and run the basic packstrap command. So what this will do,
this will install the base arch system. So you packstrap slash MNT and then install certain
packages like base, which is the base packages Linux, which is your kernel Linux dash firmware,
which is very important. I'm going to install a couple of other packages I know I'm going to need,
so I might as well do them now, sudo and vim, because I need a proper text editor.
And now it's going to install all of the base system plus sudo and vim. This will take a couple
of minutes. Well, that installation went very quick. It only took about a minute to install
those packages. And next we need to chroot into our new installation. So I'm going to run the
command arch dash chroot to change the root file system over into slash MNT. That is where our
future Arch Linux installation is mounted to. First, let's set the time zone. So we need to
run time date CTL and then list dash time zones. Now this gives you a list of all the available
time zones on the system. For me, I know mine is America slash Chicago. I don't live in Chicago,
but Chicago is in the central time zone. I'm in the central time zone. So if you're unsure about
your region slash city, because you need that region slash city and you need to get that
information and then you need to run the time date CTL command set dash time zone and then
region slash city. So for me, America slash Chicago. And if it doesn't give you an error
message, it was set correctly. Next, we need to set the hardware clock. So do H W C L O C K. So
hardware clock dash dash sys T O H C and then hit enter. And that's all you need to do there.
And then let's go ahead and set the locale. So nano is on the system. You can use nano
as your editor. For me, I'm going to use Vim because that's why I installed it. And I'm going
to use Vim slash Etsy slash locale dot gen is the file we need to edit. And I need to search for a
specific locale to uncomment. Every line in this file is commented. I'm going to search for English
underscore us. So let's go down to that line and there it is. And I just need to uncomment that
and then let me write and quit. And now we set English us to our locale. Of course,
that just changes a line in the file to actually set it. We need to run the command locale dash
gen. One final file I want to edit is the slash Etsy slash locale dot comp, which is an empty
file. And I need to do Lang, all caps, equals, and then EN underscore US dot UTF dash eight,
and then write and quit out of that. Next, let's set our host name. So I'm going to Vim slash Etsy
slash host name. This is the file that contains the host name of the computer. I'm going to call
this computer Arch. So that will be the host name of the computer. Next, I'm going to up arrow and
this file already exists and it's correct. There's no need to edit this. In old days,
this used to not be a file that contains stuff. You actually had to write all of this yourself.
Now you don't. So great. Nothing to do there. Next, let's set our passwords. Right now,
of course, I'm logged in as the root user. The root user is the only user on the system. So
let's go ahead and set his password. Let's do pass WD to set the password. I'm going to give
the root user a strong and complicated password. Hit enter, retype the password. There we go. Now
let's go ahead and create our normal user. I'm going to do a user add dash M DT is my normal
username, right? So now we need to go ahead and create a password for DT. So pass WD space DT to
create DT's password. Confirm. And we set his password. We need to make sure DT is actually
added to some groups on the system. So we're going to do a user mod dash lowercase a capital G
to add him to some groups. We're going to add him to these groups. Wheel, audio, video. It's
very important. No spaces here. And then optical, storage, input, and then finally space DT. DT's
the user we're adding all of this to. And there we go. Now remember earlier, we installed sudo.
We need to make sure that DT has sudo privileges. We added him to the wheel group. So that gives
him sudo privileges, but only if we allow every member of the wheel group to have sudo privileges.
And to do that, we need to run the command VI sudo to get into the sudoers file. And we need
to scroll down to the line where we find wheel. We could actually just search for wheel. There we go.
This is the line right here. And it says uncomment to allow members of the wheel group to execute
any command. So let's go ahead and uncomment that and then write and quit. Next, let's go ahead and
install a package called ZRAM dash generator because we haven't set up the swap yet. I'm
going to use ZRAM as a swap. So pacman dash capital S ZRAM generator. And let's go ahead
and install that. And then I need to vim slash etsy slash systemd slash and then ZRAM dash
generator dot comp is the file. And we need to actually write this file ourselves. So at the top
inside brackets, we need to write ZRAM zero. And then next line we need to do ZRAM dash size equals
and it's going to equal our RAM divided by two. So the ZRAM size is half of our RAM size. Next line
is compression dash algorithm. If I can type that correctly equals ZSTD is the standard algorithm
compression. Next is swap dash priority equals 100. And then finally mount dash point equals
slash dev slash ZRAM zero. And then write and quit out of that. Now later we will need to actually
enable ZRAM through system CTL through systemd. But we can't do that right now inside this
rooted environment. But we'll do that at the end. Next up, let's go ahead and install grub because
we need a boot loader. So let's pacman dash capital S grub. And because we're doing EFI,
let's also install EFI boot MGR EFI boot manager. Let's install those two packages. We need to make
dir so we need to make another directory dash P and this needs to be at slash boot slash EFI.
That's our EFI partition there. And then finally mount slash dev slash vda1 is our EFI partition.
We need to mount that to slash boot slash EFI. And then this command here the grub install command
to install grub space dash dash target equals x86 underscore 64 dash EFI space dash dash EFI
dash directory equals slash boot slash EFI and then space dash dash boot loader dash ID equals
grub all caps very lengthy command but it's important we get this right and no error reported
and then finally we need to run the grub dash make config command so grub mkconfig dash o and
that needs to be at boot slash grub slash grub dot cfg. Now let's actually install some packages
and like graphical packages and stuff. First for networking I know I want network manager so I'm
pacman dash capital s network manager. It just makes getting internet and wi-fi and everything
set up so much easier. I'm going to install sddm which is going to be our login manager. Let's just
install those two packages for now and now that we've done that I don't think we can enable them
in this cherooted environment but let's see network manager with a capital n and a capital m
and yeah it can't create that because systemd is not running so we've got to do this outside
of the cherooted environment. I'll remember to enable that here in a minute. We also need to
make sure that we enable zram in a minute as well so we've got a lot of systemd services
to enable here in a minute but let's continue with pacman dash capital s. Let's install
everything we need so I'm going to go ahead and install base govel because I know I'm going to
need that. I'm going to need git as well. Base govel and git are needed if you ever plan on
installing anything from the aur because it has to be able to build packages and base govel
contains a lot of the make tools. Git of course is how it downloads things so we need those two
packages. Let's go ahead and install the aur helper. Let me go ahead and su over into the dt user
because you can't install aur packages as root. You have to be a normal user so I'm going to
switch over to my dt user and I need to switch over to his home directory so I need to just
hit the cd command and if I do print working directory I am in slash home slash dt. Let's go
ahead and run a git clone https colon slash slash aur dot arch linux dot org slash yay dot get.
Let's install the yay aur helper. So that just cloned the yay directory so let's cd into yay
and then let's run the command make pkg make package dash si and this makes the yay binary
package. It installs it for us as well. You need to give it sudo privileges at the end to install
the package and yay finished installing and then finally what I need to do is now I need to do a
sudo pacman double s because I have to use sudo now that I'm the dt user and I'm going to install
this list of packages. I'm going to install alacrity for the terminal then my window manager
will be niri pcmanfm for a file manager and then various other utilities quickshell sway bg for
setting wallpaper sway idle to put my screens to sleep sway lock for lock screen some font families
as well as some desktop portals. I'm going to use the gnome desktop portal and the weyland
wl roots portal as well. Let's go ahead and run that give my sudo password and away we go
and then I need to install some aur packages that are very important to me brave is my browser dms
is the dank material shell for niri which I love and then the microsoft fonts and then way paper
for being able to set wallpaper in a wayland compositor so I'm going to run all of that
and all of that installed correctly finally we need to exit out of the root so let's hit exit
I might need to exit a couple of times because I was logged in as dt so my exit
exited back out to the root user and then one more exit gets us back to root at archiso now I
am still mounted if I do a lsb okay you can see I'm still mounted let's do a umount to unmount
dash l for a lazy unmount and now we're unmounted what I want to do is I want to go ahead and reboot
the machine and when it reboots let's just make sure grub is working and if it everything is
working then finally the last thing I need to do is enable those systemd services so we get a
prompt let me log in as my dt user I get an error that his home directory doesn't exist I need to do
something about that let me change the tty font to something uh different here so you guys can
see the command I need to make dt's user so I need to go ahead and uh sudo make gear slash home
dt and now we've made his home user so I won't get that error message anymore and then finally
let's go ahead and enable those systemd services so sudo systemctl we need to go ahead and start
slash dev slash zram zero that's our zram swap and then gonna up arrow sudo systemctl let's go
ahead and enable dash dash now network manager and again capital n capital m and then finally
let's go ahead systemctl enable sddm for our login manager and now let's reboot and see if it boots
us directly into sddm and we get our login manager so let's see if we can log into niri and we get a
black screen I'm assuming that's going to be a virtual machine graphics driver problem but let's
go ahead and solve the virtual machine problem because some of you guys are probably going to
install this invert manager so let me force off the machine here let's go into the settings I know
what the problem is so let's go into the settings we need to make sure our device driver is virtio
it needs 3d acceleration so let's turn that on also go to display spice and make sure that listen
type is none and let's turn on the open gl let's hit apply let's go ahead and restart the machine
make it full screen and now let's go ahead and log into niri and there we go niri it's not set
up it's not configured in any way there's no way you would be able to just immediately use niri and
do anything you've got a terminal and some other basic stuff I installed the brave browser but
you'd have to do a lot of configuration from this point but this was just the basic command line
arch linux installation from there you go ahead and tweak things you configure it to your liking
but this arch linux installation this command line manual way of installing arch linux it's
not nearly as hard as people make it out to be and I have no idea if this installation process
came out to 15 minutes I talk a little bit I ramble on but this was pretty quick right this
is not something that's going to take even if you take your time reading the arch linux wiki
this definitely should not take more than about half an hour for most people now before I go I
need to thank a few special people I need to thank the producers of this episode matt steve
george darloff lee mark methos erjan peace archimedor roland wargen 2 and abuntu and willie
these guys they're my highest tiered patrons over on patreon without these guys this quick little
episode about installing arch linux the archway would not have been possible the show is also
brought to you by each and every one of these fine ladies and gentlemen all these names you're
seeing on the screen these are all my supporters over on patreon because I don't have any corporate
sponsors I'm sponsored by you guys the community if you like my work and want to see more videos
about linux and free and open source software subscribe to distro tube over on patreon peace guys