š¾ Archived View for gemini.mcgillij.dev āŗ installing-arch.gmi captured on 2023-09-28 at 15:57:30. Gemini links have been rewritten to link to archived content
ā¬ ļø Previous capture (2021-12-03)
-=-=-=-=-=-=-
: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
This is not a replacement for the
.
Anyone interested in a modern Linux desktop environment, playing games in Linux(SteamOS / Steam Deck!!! But on desktop?), virtual machines and developers etcā¦
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.
) are another incredible thing in the Arch world bridging the gap for installing projects not in the main archives.
is a tremendous resource that only Gentoo comes close to.
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
.
While there is technically an āinstallerā I will not be covering that.
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.
Ok with that out of the way onto the installation and choices.
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.
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.
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.
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.
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:
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.
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.
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:
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).
I chose
, 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.
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
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".
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.
Looks good, those are the partitions I setup earlier.
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*.
The rest of these commands unless noted, will be run from within the chroot.
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
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen locale-gen echo "LANG=en_US.UTF-8" > /etc/locale.conf
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.
echo "archbox" > /etc/hostname cat << EOF > /etc/hosts 127.0.0.1 localhost ::1 localhost 127.0.1.1 archbox.localdomain archbox EOF
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
Finally setting a **root** password with the following command.
passwd
There are many choices here, I went with
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
Reboot and your running Arch.
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.
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!