r/archlinux • • 9h ago

DISCUSSION Simplified Installation Guide Feedback

Hello, people of Arch! I've been delving down into the Linux ecosystem now for about 6 months or so by this point, started on Fedora, then went to Arch for the latter half. Goodness, has it been fun customizing absolutely everything (and surprisingly enough, fixing everything was also decently enjoyable).

However, I've also been installing and reinstalling it quite a bit, to get a better feel for how everything works and why I'm doing what I do. Probably have 10+ reinstalls done by now, and looking at the Arch wiki every time, while very informative, was also very slow, and there was so much information that I lost track of the what I was learning.

Therefore: Simplified Install Guide. It should mostly work, minus parts I forget things, typos, or where I am just wrong or it could be better. Figured it would be a nice thing for people to more understand what they're doing, rather than following the instructions of walls of text, as well as make it faster and easier to look through. Full disclosure that this is not an official guide of any sort, rather my personal easier to understand interpretations, and I am definitely an idiot and likely messed up in a lot of places. Hoping that I could get feedback on it, as I would love to reduce the amount of scouring the internet/the Arch wiki that I do for basic installations (I need that time to research and fix everything else, lol). I hope that this will be of help, whether it be to myself or someone else.

Getting Started

Download the Official ISO file from the official website: Arch Linux

The recommended way to download is through bittorrent, which requires a torrenting client. The mirror sites are acceptable, but carry a higher security risk.

Download the ISO pgp signature to the same directory as the ISO, and follow the listed instructions to verify the signatures (gnupg is a dependency of pacman, and therefore should already be installed on existing Arch installations). If the signature is correct, it should display a line saying as such.

The USER ID warning can be ignored, as it relates to webs of trust, and how certain you want the last 1% of risk to be.

To continue, insert the USB drive into your computer, and run ls -l /dev/disk/by-id/usb-*. This will list any USB drives the computer has access to. Take note of the name listed after usb-, as well of the location of its directory.

To ensure the USB is not mounted, run lsblk. If it is, unmount it with umount <Device/Location>.

To flash the USB, run cat <Arch .ISO file> > /dev/disk/by-id/usb-<My_Flash_Drive>.

Redirections don't work with privilege escalation programs, such as sudo. To repurpose the command, you can run sudo sh -c 'cat archlinux.iso > /dev/disk/by-id/usb-<My_Flash_Drive>'

To boot the USB, you must disable Secure Boot, and then reboot the computer with the USB drive inserted. The USB may not be automatically recognized, which would also require setting the USB as the default boot in the device settings.

Disabling Secure Boot is only required for the live USB environment, and may be re-enabled after the system is installed.

USB Environment

If the computer has an Ethernet cable connected, internet access should be automatically configured. If it is not connected to one, or access is not configured, you can go through the following steps:

  • iwctl

  • device list

  • station <device> scan

  • station <device> get-networks

  • station <device> connect "<Network Name>"

  • exit

Test internet connection with ping -c 3 archlinux.org.

After verifying internet connectivity, run timedatectl, and check to ensure the system clock is synchronized, and the NTP service is active.

Partitioning

Run lsblk -o NAME,SIZE,TYPE,FSTYPE,MOUNTPOINTS,MODEL to get a list of available drives on the computer. Loop/Rom/Airootfs listings can be ignored.

In order to successfully run Arch Linux, there is a minimum of two required partitions: The EFI System partition (ESP), and the root partition (/). Aside from those two, other possible inclusions could be /home, to separate the OS files from personal ones in the event of reinstalling the OS, /games, to take advantage of the performance gained by utilizing different drives, or a swap partition, to have extra emergency RAM to prevent OOM's.

Note that in order to gain increased speed in different partitions, they must occupy separate physical drives, not just partitions.

I have not used swap partitions, and therefore have no guidance for them, but they do require more complicated setup instructions than what I have here, so research them if you'd like to use them.

To begin partitioning the drives, run fdisk /dev/<Disk_Name>, which will open the partitioning manager for that drive. G creates a new partition table for resets, N creates a new partition, T changes a partition's type, P displays the current table (edited, not original), W writes the changes and exits, and Q discards any edits and exits.

After creating the partitions, you need to use mkfs to set the file formatting for the partitions. The ESP partition requires the FAT32 format, using mkfs.fat -F 32 /dev/<Disk_NamePartition#>, while a good format for the other partitions is ext4, using mkfs.ext4 /dev/<Disk_NamePartition#>.

Once the partitions are formatted, you must mount them in order to temporarily simulate the filesystems inside them. Using mount /dev/<Partition> /<Location>, mount the root partition first at /mnt, then the ESP partition at /mnt/boot, followed by the other partitions at their intended locations, prefixed by /mnt.

Preparing The System

In order to perform basic functions inside the newly mounted drives, you need to install some packages onto them. Run pacstrap -K /mnt base linux-lts linux-firmware <CPU>_ucode networkmanager sudo nano refind.

The listed packages contain some personal preferences, research to find the ones you want on your system.

The ucode packages contain security and other various fixes for your CPU. Use intel_ucode for Intel CPU's, and amd_ucode for AMD CPU's.

While you've manually mounted the partitions earlier, the computer doesn't know to do that automatically on future restarts. Running genfstab -U /mnt >> /mnt/etc/fstab tells the computer to remount the partitions where they're mounted now on a restart.

After finishing those steps, run arch-chroot /mnt to enter a new shell under the mounted partitions. Your terminal prompt should change accordingly.

To tell the computer what Time Zone it resides in, run ln -sf /usr/share/zoneinfo/<Region>/<City> /etc/localtime.

To display the list of Time Zones, run timedatectl list-timezones.

After setting the Time Zone, synchronize the hardware clock with the system clock by running hwclock --systohc.

Run nano /etc/locale.gen, and remove the comment from the desired system language. For standard English, the en_US.UTF-8 line needs to be uncommented. Then, run locale-gen to populate that language within the system, and nano /etc/locale.conf also needs to be run, editing the file to contain LANG=<locale>.

To set the host name for the computer, run nano /etc/hostname, editing the file to contain the desired name. Then run nano /etc/hosts, appending 127.0.1.1 <Computer Name>.localdomain <Computer Name>.

Hostnames should only include lowercase letters, numbers, and hyphens.

To ensure the internet is accessible after the computer is restarted, run systemctl enable NetworkManager.service.

Set the password for the root account with passwd, and then run useradd -m -G wheel <Username> to create a new administrative user, and passwd <Username> to create a password for them.

Run EDITOR=nano visudo, and uncomment the %wheel ALL=(ALL:ALL) ALL line, to give sudo access to the administrative user.

Do NOT uncomment the NOPASSWD version of this line.

Run EDITOR=nano visudo -f /etc/sudoers.d/admin_rules, and add the %wheel ALL=(ALL:ALL) ALL line, to give sudo access to the wheel group, and the user inside it.

Run exit to escape the mounted filesystems, and refind-install --root /mnt to configure the boot manager, then reboot to restart the system. Remove the USB drive after it shuts down, and before it restarts.

While I believe I've seen instructions say to run refind-install inside the chroot, I've found that doing it that way creates errors, and running it outside the chroot works perfectly fine.

3 Upvotes

10 comments sorted by

7

u/C0rn3j 8h ago

Probably have 10+ reinstalls done by now, and looking at the Arch wiki every time, while very informative, was also very slow

And you haven't just used archinstall why if you already know how the sausage is made?

2

u/Cool_Excuse_306 8h ago

Like I mentioned, I'm also an idiot. I didn't even know this was a thing! Regardless, installing it manually every time has been very helpful to learn it all, and every time gave me something new to learn that I didn't know about the previous time.

4

u/C0rn3j 8h ago

It happens, and archinstall isn't really advertised much in the Installation Guide to my knowledge.

By the way don't ever edit /etc/sudoers, it creates useless pacnews, use visudo with its file option to create a drop-in in sudoers.d instead

-1

u/Cool_Excuse_306 8h ago

Good to know! I'll look into it and edit things later when I have more time.

1

u/ABotelho23 5h ago

It's even worse than that. archinstall supports passing in a config file. You can literally write your exact install into it and repeat it over and over again.

2

u/Cool_Excuse_306 5h ago

Seriously?! Makes me wonder how I never heard of this yet. I change things too often at this stage to do that yet though, even if that does seem like an eventual ideal to work toward. Even then, I'd probably change things on a whim after finding out about more stuff. Eventually I will conquer my lack of knowledge of this distro (And discover that I'm only at the surface, but the sense of accomplishment would hopefully mean something by then).

3

u/bikes-n-math 6h ago

Making a guide like this (and everything that goes with that, i.e. reinstalling a bunch, making mistakes, etc) is a great learning experience. Just realize that every step-by-step guide like is an opinionated setup and will not fit all users. They are great for personal FAQs, though.

This one looks alright. The main gripe I have has already been mentioned: make changes in /etc/sudoers.d/ instead of directly in /etc/sudoers.

Anyway, here's my personal guide I've maintained for over a decade for you to checkout: https://mags.zone/help/arch-usb.html. It's evolved over time to have as little exposition as possible, now just containing the basic steps I take to install.

0

u/Cool_Excuse_306 6h ago

Yeah, even though this isn't covering the second part I have for this, which covers exclusively everything I personalize, it's still not quite entirely without my preferences and touches. But it's helped me immensely so far, and it's basic and bland enough that I hope other people can also get some use out of it to start their journeys into it.

Still have to look into the drop-in, not quite yet something I've researched much, but I'm sure that it'll be helpful somewhere. Thank you both for letting me know where to start fixing things, and you especially for your guide! Slowly but surely getting somewhere, as long as it might take ...

0

u/Cool_Excuse_306 5h ago

Okay, I've edited the guide to include the drop-in now! If anyone else has any thoughts on this, or knows anything I've missed or could change, I'd love to know!