šŸ’¾ Archived View for gemini.mcgillij.dev ā€ŗ installing-arch.gmi captured on 2023-11-04 at 11:22:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

ā¬…ļø Previous capture (2021-12-03)

-=-=-=-=-=-=-

Installing Arch Linux (with helpful screenshots)

:author:

mcgillij

:category:

Linux

:date:

2021-08-12 21:49

:tags:

Linux, Arch, #100DaysToOffload

:slug:

installing-archlinux

:summary:

Not a replacement for the installation wiki, but a complement for newer folks interested in Arch.

:cover_image:

arch.png

Contents

Preface

This is not a replacement for the

installation wiki

.

Who is this for?

Anyone interested in a modern Linux desktop environment, playing games in Linux(SteamOS / Steam Deck!!! But on desktop?), virtual machines and developers etcā€¦

What makes Arch different?

What does this mean practically? You will *need* to have actual opinions about how you want your system to run, as well as the applications that you want running.

Arch User Repositories

) are another incredible thing in the Arch world bridging the gap for installing projects not in the main archives.

Wiki

is a tremendous resource that only Gentoo comes close to.

New to Linux? Should you install Arch?

You totally can, farbeit for me to stop you, however itā€™s generally not recommended as a first Linux distribution *choice*. If your goal is to get up and running with Linux quickly, Iā€™d highly suggest using

Manjaro

.

Installer?

While there is technically an ā€œinstallerā€ I will not be covering that.

Whats wrong with other distributions?

Nothing, they all set out to do their own thing. They for the most part offer opinionated installations, with varying degreeā€™s of sane defaults. Most distributions canned choices are often harder to trim down post installation than Arch is to configure from scratch which is why Iā€™m going to go over the installation process, in the event that you are curious with the installation process and choices Iā€™ve made while installing Arch.

Onward to the installation

Ok with that out of the way onto the installation and choices.

Booting the installation media

Once youā€™ve booted the USB image, youā€™ll be greeted by the grub menu that looks like the following. From here you have several options, you can run memory tests, boot into existing OSā€™s or install Arch Linux. Lets choose that option.

[image: grub arch screen]

root@archiso ~ #

[image: arch_root]

Ok so now assuming you have internet access you can acccess the installation wiki by typing in **installation_guide** and reading along. You are now in whats commonly referred to as the ā€˜liveā€™ (on usb, cd or ram) environment. From here we will be provisioning our system to run Arch Linux.

Partitioning your disk(s)

As with most Linux installations your going to have to partition your disk. There are a number of tools at your disposal in the *live* environment that you can use to-do this.

root@archiso ~ # lsblk
NAME        MAJ:MIN RM   SIZE RO TYPE MOUNTPOINTS
vda         259:0    0    40G  0 disk

Your entries may look different depending on if you have SATA, NVMe drives. Once you spot the drive that you want to use, you can proceed to the partitioning.

Note: that your disk will likely be named: "/dev/sd*" or "/dev/nvme", mine in the examples are "/dev/vda" since Iā€™m installing it in a VM since Iā€™m already running Arch, and not installing it again while doing this tutorial.

Partitioning

Unless you have a specific use-case, you can just use a pretty generic partitioning scheme that I will outline below.

You will *need* a "/boot" (optional if your system will only have Linux installed), "/" (root) and "swap" partition at the very least. You may also want "/var", "/tmp" and "/home" on their own partitions.

As a minimum, you will want to have at least **256MB** for your "boot" partition, **512MB** for your "swap" and the rest of your disk for your "/" (root).

cfdisk /dev/vda

Select the gpt label type.

[image: cfdisk gpt]

[image: making partitions]

You will want to select ā€œNewā€ on your free space, and create your "boot" partition, and enter the size you want. Repeat this for your "swap" and "/" (root) filesystems.

Once youā€™ve got those created, select ā€œWriteā€, and then ā€œQuitā€ and we can move onto formatting those partitions and mouting them for the installation. You should have something like the following:

[image: partitioned]

Lets run **lsblk** again to see our partitions.

[image: lsblk showing new partitions]

Now you can see the partitions that we created, now lets format them appropriately.

Formatting and turning on the Swap

Firstly lets format our boot partition as **vfat** (since I also have a Windows partition that can use the same bootloader).

mkfs.vfat /dev/vda1

Now we can format our "swap".

mkswap /dev/vda2

And finally our "/" (root).

mkfs.ext4

OK, with the partitions made, we just need to *turn on* the swap and we are ready to mount them for installation.

swapon /dev/vda2

We havenā€™t done anything out of the ordinary so far that wouldnā€™t be done already by a regular OS installation. Remember to use your own device names and not the *vda* devices listed above.

Mounting the filesystems

Firstly we will mount the root filesystem directly to "/mnt", creat the ā€œbootā€ directory and then mount the "/boot" partition in there with the following commands.

mount /dev/vda3 /mnt
mkdir -p /mnt/boot
mount /dev/vda1 /mnt/boot

Verify that you have the partitions mounted properly with something like:

[image: mount | grep vda]

Installation starts!

Now the actual ā€œinstallationā€ starts as in packages get fired onto your disk. And you get to start making some choices (or in this case see the ones Iā€™ve made for my use-case).

Which editor to use?

I chose

nvim

, but you can use whatever editor you want, choose one that your at least familiar with and confortable editing files from the command line with.

Boot strapping

We will now bootstrap the installation. Installing the bare minimum required to get the OS installed (you can further tweak this later as well).

pacstrap /mnt base linux linux-firmware neovim grub efibootmgr

This installs the Linux

Kernel

the firmware packages used by most hardware and GPUā€™s along with a minimal set of tools used to strap together a minimal Linux system and Grub (our bootloader, optional if you want to install a different one).

Once that is finished you should see something like:

[image: pacstrap'ing a system]

We can check now to make sure everything got installed correctly into our filesystem by checking out what got installed in "/mnt".

[image: ls /mnt]

fstab

Now we will populate */etc/fstab*, the Arch team have provided a handy utility called *genfstab* that we can use for this.

genfstab -U /mnt >> /mnt/etc/fstab

We can make sure our entries correctly got added to the */mnt/etc/fstab* by looking at it as follows.

[image: /etc/fstab]

Looks good, those are the partitions I setup earlier.

Chrootā€™in

Now we will play with our toy Linux system **FROM WITHIN**. If youā€™re not familiar with chrootā€™ing itā€™s a jailed environment that cannot **see** outside of itā€™s jail. We do this now to tweak our installation without having to boot into it yet.

arch-root /mnt

Again the Arch team have provided a custom utility for doing this (you could also use regular **chroot**, but youā€™d have to mount some extra things).

You will notice your prompt change, this is to indidcate that you are now operating from within the *chroot*.

[image: arch-chroot]

The rest of these commands unless noted, will be run from within the chroot.

Setting TimeZone

Since Iā€™m in Halifax, Iā€™m setting that TimeZone, but set whatever is appropriate for you.

ln -sf /usr/share/zoneinfo/America/Halifax /etc/localtime
hwclock --systohc

Setting your locale

echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen
locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf

DNS and Networking

To find out which network interfaces you have, you can run the following command.

ls /sys/class/net/

You will use this device name (not "lo" since this is the loopback device) in the following section.

Local DNS

echo "archbox" > /etc/hostname
cat << EOF > /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 archbox.localdomain archbox
EOF

Wired Networking

The following section sets up DHCP networking for the interface we found above. And I put in my DNS serverā€™s address there, yours will be different so keep that in mind.

cat << EOF > /etc/systemd/network/20-wired.network
[Match]
Name=enp6s0

[Network]
DHCP=yes
DNS=192.168.2.16
EOF

Root password

Finally setting a **root** password with the following command.

passwd

Grub (bootloader) on /boot

There are many choices here, I went with

Grub2

since itā€™s the one Iā€™m most familiar with and have used it for years, if you want to use a different one refer to the wiki. However the steps are likely very similar.

Since we installed **grub** with the **pacstrap** command above and mounted our */boot* partition earlier, we need only run the following command to install our bootloader.

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg

Thatā€™s it

Reboot and your running Arch.

[image: MAGIC]

You may be asking, whereā€™s my *graphix*, well now you get to choose which Desktop environment, Window manager and login manager if any that you want to use. What we have here is called **bare bones** system. From here you could run a minimalistic server configuration, create a cloud image, setup a gaming machine or all of the above.

Generally you donā€™t get to make these decisions when installing other distroā€™s, and this is the reason I recommend having an opinion or goals prior to installing Arch.

While it is possible to install just about every DE / WM available out of the box, itā€™s nice to actually get to choose which one you want to run rather than leaving that decision upto the distribution maintainers that may have been trying to solve different problems than you.

My installed packages

I generated this list with **pacman -Qqe**

alacritty
alsa-utils
amd-ucode
amdvlk
amfora
arandr
ardour
asp
aspell
atom
autoconf
automake
autorandr
awesome-terminal-fonts
base
bc
bdf-unifont
bind
binutils
bison
bpytop
cadence
carla
chromium
cmake
cmus
deluge
deluge-gtk
devtools
discord
dmenu
dmidecode
dnsmasq
docker
dwarffortress
ebtables
edk2-ovmf
efibootmgr
electrum
evemu
fakeroot
feh
figlet
firefox
fish
flameshot
flatpak
flex
freerdp
fzf
gamemode
gcc
gdb
gimp
git
glances
glmark2-git
glu
gource
goverlay-bin
groff
grub
gst-plugins-bad
gst-plugins-base
gst-plugins-good
gucharmap
i3-gaps
i3blocks
i3lock
i3status
inetutils
jack2
jack_mixer
joyutils
lib32-amdvlk
lib32-vkd3d
lib32-vulkan-radeon
libnotify
lightdm
lightdm-gtk-greeter
linux
linux-firmware
linux-zen
linux-zen-headers
lshw
lsof
lua
lutris
m4
make
man-db
man-pages
mangohud
mangohud-common
meld
mesa
mpv
namcap
neofetch
neovim
nfs-utils
noto-fonts
noto-fonts-emoji
ntp
nut
obs-studio
optipng
os-prober
pacman
pacman-contrib
pacutils
pamixer
patch
pavucontrol
peek
perl-anyevent-i3
picom
pipewire-alsa
pipewire-jack
pipewire-pulse
pkgconf
pkgstats
powerline
powerline-fonts
powertop
psensor
py3status
pyenv
pyside2
python-dephell
python-google-auth
python-google-auth-oauthlib
python-pip
python-pygithub
python-pynvim
python-rich
python-tzlocal
qemu
qjackctl
radeontop
ranger
rdesktop
retext
ripgrep
rofi
ruby-manpages
ruby-rainbow
scrot
sdl2_ttf
sensors-applet
shellcheck
spice-protocol
steam
strace
strawberry
sudo
texlive-bibtexextra
texlive-core
texlive-fontsextra
texlive-formatsextra
texlive-games
texlive-humanities
texlive-latexextra
texlive-music
texlive-pictures
texlive-pstricks
texlive-publishers
texlive-science
texstudio
texworks
thunderbird
tk
tmux
ttf-font-awesome
ttf-hack
ttf-inconsolata
ttf-nerd-fonts-symbols-mono
ttf-roboto
ttf-roboto-mono
ueberzug
unrar
usbutils
virt-manager
vkd3d
vlc
vulkan-mesa-layers
vulkan-tools
vulkan-validation-layers
w3m
weechat
wget
which
wine
wine-gecko
wine-mono
wireplumber
xclip
xf86-video-amdgpu
xmlto
xorg-server
xorg-xinit
xorg-xkill
xorg-xrandr
zip

But Iā€™ll leave you with this. Learn to use **pacman** since itā€™s Archā€™s package manager, and it does a great job of resolving all the dependencies between packages.

Let me know what you install!