Arch is a very lightweight distribution based on systemd init system and for a lot of people it’s the most useful distro due to his powerful package manager (pacman) and the AUR (Arch User Repository) where you can find every software you want.. trust me, everything.
For many people the “problem” of Arch is his installation process because, on the official iso, you have to install it via terminal, so no gui.
When me and my friend Mattia booted for the first time Arch it was disconcerting for us: we didn’t think we had to do everything from the terminal! The first reaction was and now? So we started looking for guides and tutorials on how to install this (at the time) impossible distribution and after a lot of attempts we did it.
This guide comes from that experience and from all the little minutiae found around and obviously we did not know of the existence of the magical wiki.
Before we start with the guide I want to say that I’ve also created an automated install script called myArchInstaller for the installation but.. you know, it’s better if you install it by hand.
I want to clarify one thing: this guide is created with the purpose of being easy to understand and quick. Some points could not be correct for your computer (I refer to a computer with a wired internet connection and a uefi bios). If so, I suggest you go to the official guide to consult your specific case.
So, here we are!
1. Medium creation
The first step concerns the creation of the usb medium which contains our arch iso. Go on the download page, pick the best mirror for you and download the iso. After that insert the usb drive you want to use for the medium, run an lsblk
command and check which drive is your medium. Then write the iso using dd command:
If you don’t have write permissions use it with sudo or doas.
2. Reboot and run your arch medium
Do I have to tell you how to do it?
3. (optional) Load you keyboard translation tables
If you don’t have an us keyboard you must load you keyboard translation tables. How? Check your layout with
and then use the command
4. Disk partitioning
Check the disk you want to use for you arch installation with one of these two commands: fdisk -l
/ lsblk
.
Run
to manipulate your partition table and select the GPT partition table. Now this part is very important, you have to declare spaces for each individual partition! I suggest you my usual configuration:
Partition number --- size --- filesystem type --- purpose
- 500MB --- EFI System --- EFI boot partition
- 8/16GB --- Linux Swap --- Swap partition
- rest of the space --- Linux --- Linux system
So create and write them.
5. Filesystems
Now you have to generate the filesystem for each partition. If you followed the previous step you can generate your fs typing these commands. Follow this example: the partition no. 2 of your drive (for this example sdb) will be /dev/sdb2.
Remember to enable your swap partition running the command
6. Disk mount and creation of the linux filesystem
Mount the partition you will use for the linux system with
and “populate it” installing packages to the specified root directory with the pacstrap command. I usually install in addition to the kernel, firmware and basic applications also nano, a text editor. So launch the command:
and wait the download and installation process.
7. Generate the fstab file
This is another important step because the fstab file (located in /mnt/etc/fstab
) contains the partitions which need to be mounted at startup. Run:
8. Chrooting and setting up the system
Now we have to set up some things like the locales and the hostname. To do this we need to chroot the newly created system with:
- If you don’t now your specific timezone you can print all of them with:
After that you can select it using:
- Now it’s up to locales. Use
nano
to edit the file which contains all the locales and uncomment your preferred locale:
Now generate it using
- Set up your language printing it with the echo command:
- You have to define a name for your machine. You can call it how you want but for this example i’ll use the name arch:
- Now it’s the
/etc/hosts
time. Open it with
and fill it with these lines:
- A password is something you need to know to log in the system. So.. type
and write a password for the root user.
- (optional) If you want to create now another user you can follow this point. In always create an user with the wheel group permissions, so I have first to set the wheel permissions to be used with sudo. To do this type
to open the sudoers file and uncomment the line where is written allow members of group wheel... Now we can create an user with sudo permissions!
this command will create your user! To set the password simply type passwd and immediatly after your username, like
- This is the last point of the section, I promise you. We’ve to set up the internet connection. To do this let’s use the package manager pacman to download net-tools (configuration tools for Linux networking) and networkmanager (a connection manager). To do this use this command:
. So now enable the service for the next boot using systemctl:
9. Grub
We are at the last section, perhaps the most important.. we have to install the bootloader, in this case GRUB. Let’s install the binaries with
After that we have to create the EFI folder where we will mount the EFI partition. So type
and
to mount it. Here we are, let’s install and create the grub configuration file. Type
to install grub in the efi directory and
to create your config.
We’have finished! The arch installation process is complete, you can now reboot to your system typing
Have a good time :)