Thematic background picture about Tech

Installing Arch for my use

...or, how I learned to re-install without thinking

I recently wanted to re-install my Arch Linux setup due to a couple of hard-to-debug issues that had cropped up after switching from NVIDIA to AMD for my GPU. What I really didn't want, however, was to spend hours getting back to the setup I had previously, so this time, I dove into the new official installer, arch-install.

Now, the arch-install part of this whole thing is actually pretty simple. arch-install lets you set up configuration files from within your existing installation, so you don't have to make hard choices while you're in the bare environment of the installer image.

To do this, install arch-install using your prefered method - the package name is archinstall - and then just run the following and go through the options:

1sudo archinstall --dry-run

You'll end up with three configuration files that you can edit to your preference and put on a separate partition of your install media (e.g. USB stick) to pass to arch-install when you're ready to install. This takes care of the basics of partitioning your drive, installing a bootloader, setting up your network, sound and graphics drivers, and installing the base packages for your choice of system (minimal Xorg, KDE, Gnome, etc.).

For my use, I let arch-install pick its default partition layout and then tweaked the file afterwards so it didn't use the entirety of my 1TB NVMe drive for the root system.

What follows is the general setup of the system. This will vary based on what you need for your system, but for me, it boils down to the following list, which I've created scripts for:

setup-system.sh

setup-amdgpu.sh

  • Add the Vulkan packages for my AMD GPU

setup-ecryptfs.sh

  • Set up an encrypted directory in my home directory

setup-packages.sh

  • Install the paru pacman helper and various packages I use

If you need any of the above functionality, feel free to take a look at these scripts (the full repo is here) and adapt them how you see fit. For me - together with my stow setup for configuration files - all this means I can have a working re-install, with no need to think or remember commands, set up in no time.

With the repo - plus my config files - on a flash drive, a re-install is just:

1cd /run/media/*/flash_drive
2./install.sh
3./setup.sh

P.S. If you want to quickly get a list of the packages you've manually installed on your own system, here's a convoluted one-liner for just that:

1pacman -Qi -ett | grep -E '^(Name|Description)' | sed ':a;N;$!ba;s/\nDescription *: / # /g;s/Name *: //g' | column -t -s '#' -o '#' | grep -vE '^('"$(pacman -Qq -g base -g base-devel 2>/dev/null | sed ':a;N;$!ba;s/\n/ |/g')"')' | sort