This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
This document does not replace the official Arch installation guide
Arch installation¶
Arch Linux is an independently developed, x86-64 general-purpose GNU/Linux distribution that strives to provide the latest stable versions of most software by following a rolling-release model. The default installation is a minimal base system, configured by the user to only add what is purposely required.
Note
In this cheat sheet, one or multiple Linux distributions (distros) can already be installed on
other partitions: they will be preserved and still available through grub
.
Note
In this cheat sheet, the installation process is compatible with a virtual machine (VM) or a container. In this case, you might be interested in those cheat sheets:
Note
In this cheat sheet, UEFI won't be used as a bootloader, like described here:
https://wiki.archlinux.org/index.php/EFISTUB, the bootloader used here is GRUB2 (or grub
for
short) but it could be anything else you want.
Reference(s)
Table of contents¶
- Prerequisites
- Partitioning, formatting and mounting
- System install
- Bootloader configuration with GRUB
- Reboot
- Post installation
Prerequisites¶
-
Download the latest Arch Linux ISO image here: https://archlinux.org/download/ (and download the associated
.sig
file) -
Check the ISO image with GnuPG thanks to the PGP signature (
.sig
file): -
Follow the bellow common prerequisites steps (just the prerequisites for now).
Official documentations for the rest of the installation
Partitioning, formatting and mounting¶
- Optionaly read the optional disk encryption: drive preparation
- Read the common partitioning, formatting and mounting steps to follow.
- Optionaly read the optional disk encryption: partition preparation
System install¶
mirrors, base, kernel, utilities and fstab¶
-
Packages to be installed must be downloaded from mirror servers, which are defined in
/etc/pacman.d/mirrorlist
. On the live system, after connecting to the internet, reflector updates the mirror list by choosing 20 most recently synchronized HTTPS mirrors and sorting them by download rate.The higher a mirror is placed in the list, the more priority it is given when downloading a package. You may want to inspect the file to see if it is satisfactory. If it is not, edit the file accordingly, and move the geographically closest mirrors to the top of the list, although other criteria should be taken into account.
This file will later be copied to the new system by
pacstrap
, so it is worth getting right: -
⚠️ At this point, make sure that all partitions are mounted, after they have been created during the common partitioning, formatting and mounting steps to follow!
-
Use the
pacstrap
script to install thebase
(and optionally thebase-devel
) package group(s): -
Use the
pacstrap
script to install the Linux kernel:-
... with the following command if you don't mind binary-blob:
-
... or with the following command if you don't want any binary-blob:
-
... or with the following command if you prefer a LTS kernel without binary-blob:
-
... or with the following command if you prefer a LTS kernel and binary-blob:
-
-
Use the
pacstrap
script to optionally install other utility packages, e.g.: -
Generate a
/etc/fstab
file withgenfstab
(use-U
or-L
to define by UUID or labels, respectively):# genfstab -U /mnt/arch >> /mnt/arch/etc/fstab # you can use `genfstab -L ...` instead, for labels instead of UUID
Check the resulting
/mnt/arch/etc/fstab
file, and edit it in case of errors.See https://wiki.archlinux.org/title/Fstab for more details.# blkid # ifentify labels and UUIDs # vi /mnt/arch/etc/fstab # edit and verify (this is just an example) > # Static information about the filesystems. > # See fstab(5) for details. > > # e.g. below example with the "noatime" option optimisation (no access date > # update) and "discard" option for ssd optimisation (trim functionnalities) > > # <fs> <mountpoint> <type> <opts> <dump> <pass> > > # /dev/vda3 LABEL=MAIN > UUID=ea530bdb-1116-4618-9247-e60663fde8bd / ext4 defaults,noatime,discard 0 1 > > # /dev/vda1 > UUID=BE08-4CD2 /boot vfat defaults,noatime 0 2 > > # /dev/vda2 LABEL=SWAP > UUID=ab11cde3-fc5c-4d2f-be7c-5665e13ab272 none swap defaults 0 0
chroot
and system configuration¶
Tip
Now that the new Arch system is entered, don't forget to setup a proxy if needed,
e.g. $ export http_proxy="http://192.168.1.100:4242"
and $ export https_proxy="http://192.168.1.100:4242"
.
⚠️ Remember that with a proxy: ping
may not work! ⚠️
Note
From now on, all actions will be performed in the new Arch environment.
-
Time zone config:
See this related Arch Wiki page for more details. -
Hardware clock config (not needed on a VM):
See this related Arch Wiki page for more details[chroot]# vi /etc/conf.d/hwclock # make sure that the clock is indeed UTC > clock="UTC" [chroot]# hwclock --show [chroot]# hwclock --systohc # generate /etc/adjtime
-
Localization config:
[chroot]# vi /etc/locale.gen # e.g. for US and FR: > en_US.UTF-8 UTF-8 > en_US ISO-8859-1 > fr_FR.UTF-8 UTF-8 > fr_FR ISO-8859-1 > fr_FR@euro ISO-8859-15 [chroot]# locale-gen
Create the
/etc/locale.conf
file, and set the LANG variable accordingly:If you set the console keyboard layout, make the changes persistent by creating the
/etc/vconsole.conf
file:See this related Arch Wiki page for more details.
-
Users config:
[chroot]# passwd # set root password [chroot]# useradd -m user # add user [chroot]# passwd user # set user password
- Optional
sudo
config: seesudo
cheat sheet.
- Optional
-
Host name config:
-
Network config (see network managers), e.g. with NetworkManager:
-
Optional SSH config: see ssh cheat sheet
Bootloader configuration with GRUB¶
- Optionaly read the optional disk encryption: mkinitcpio configuration
-
Optionaly read the optional disk encryption: boot encryption
-
Optionaly read the optional disk encryption: GRUB2 bootloader configuration
- Optionaly read the optional disk encryption: swap encryption
Reboot¶
-
Exit
chroot
,umount
and reboot: -
If using a VM with UEFI, and having troubles booting, then you might want to check how to handle your first reboot with UEFI on a VM.
Post installation¶
- Read the common post installation steps to follow.
Optional kernel tweaking¶
You might want to have the choice to boot either on the latest kernel or the LTS kernel. In this case, install the following kernel related packages:
Then make sure /boot
is mounted:
Finally, update your grub configuration file:
If this cheat sheet has been useful to you, then please consider leaving a star here.