| category | Guide |
|---|---|
| title | Installation guide |
| type | GUIDE |
This file exists because I always forget that my Boot/Efi partition can't be formatted with the EXT4 file system. I also forget how I configured things last time.
So if you have any problem replicating my system, just made the change for Linux and want one more source of information or are my future self: feel free to follow this installation and configuration guide based on the official installation from the Arch Wiki.
- Correct ISO
- UEFI mode
- Have an internet connection
- Use FAT32 for the Boot partition and EXT4 for the others
- x86_64 system
- Pre-installation
- Prepare the live environment
- Boot the live environment
- Set the keyboard layout
- Update the system clock
- Partition the disks
- Format the partitions
- Name the partiotions
- Mounts the file systems
- Installation
- Install the base and base-devel package
- Basic configuration
- Fstab
- Chroot
- Time zone
- Localization
- Network configuration
- Initramfs
- Root password
- Boot loader
- Create a new user
- Download your shell
- Create the user
- Set the password
- Create the Wheel group
- Install Xorg
- Install the graphics drivers
- Install the display manager
- Install the LightDM
- Enable it
- Download and add numlockx
- Select the correct greeter
- Install the Window Manager
- Install packages
- Set configurations according to my dotfiles
Go to archlinux.org/download and download the latest .iso.
It is recommended that you download using Torrent due to the possibility of having a corrupt file. If you use direct download it is recommended that you verify the checksums by running the commands:
md5sum archlinux-version-x86_64.iso sha256sum archlinux-version-x86_64.iso
You can also verify the integraty of your .iso once you boot it by running:
gpg --keyserver-options auto-key-retreive --verify archlinux-version-x86_64.iso.sig
Next burn the .iso to your flash drive. There are several ways of doing this, I use Etcher since it's free and cross-platform.
Finally access your computer BIOS and make sure that USB live appears first in the boot order that any other bootable media that you may have installed.
When it comes to the bootloader select Boot Arch Menu. It will boot your live environment and you will be automatically logged as root in a zsh shell.
Default keyboard layout is US.
Available layouts can be listed with:
ls /usr/share/kbd/keymaps/**/*.map.gz
To select a keyboard layout run:
loadkeys layout
Example for portuguese layout:
loadkeys pt-latin9
This only changes the layout for the live environment until the next boot.
Just run:
timedatectl set-ntp true
This is probably where most systems differ.
I have 4 SSDs in my computer. One 120 Gb SSD with my EFI and root partitions, one 240 Gb SSD with my home partition, one 240 Gb SSD with my music directory and one 500 Gb SSD with my game directory. I don't have swap as I have plenty of RAM and I don't put my computer to hibernate or in suspension.
You will need 2 basic partitions: EFI and root.
Once you have one idea of what your partitions may look like you can run the following command to list your partitions:
fdisk -l
To create the partitions you can use cfdisk as it's more intuitive:
cfdisk /dev/sdX
Where X is the letter of your disk (see fdisk -l).
Wipe all partitions and create the ones you want.
You need an EFI partition with at least 512 Mb and a root partition.
This is what my configuration looks like:
Now that you have the partitions you have to format them. You can use the following commands (where X is letter of a disk and Y is the number of your partition) for each of your partition:
Swap:
mkswap /dev/sdXY swapon /dev/sdXY
EFI partition:
mkfs.fat -F 32 /dev/sdXY
Any other partition:
mkfs.ext4 /dev/sdXY
To make everything more easier lets name our partitions by giving them labels:
Swap:
swaplabel -L "new label" /dev/sdXY
Fat32:
fatlabel /dev/sdXY "new label"
Ext4:
e2label /dev/sdXY "new label"
You now have to mount the partitions on the root partition /mnt:
EFI partition:
mount /dev/sdXY /mnt/efi
Root partition:
mount /dev/sdXY /mnt
Home partition:
mount /dev/sdXY /mnt/home
If you created a partition for a specific user, for games or for music don't mount it yet.
You may want to update you mirrors before this. But I don't. You can run this script to update and rank them.
Now comes the part when you install the basic packages for your system. The only required package is base but I recommend installing the base-devel package. Run:
pacstrap /mnt base base-devel
You can install more packages besides
baseandbase-devel. For example, you can install the zen kernel with:pacstrap /mnt base base-devel linux-zen linux-zen-headers linux-zen-docs --ignore linux linux-headers linux-docsFor a list of available kernels please refer here.
I recommend installing
linux-zenfor desktop/laptop use (and gaming),linux-hardenedfor server, nas or anything that may be exposed to the network. For any other purpose, or if you don't want to mess with the kernel, just stick to the vanilla kernel as most differrences are unnoticeable.
You only need to install the
basepackage andbase-develif you're using AUR.
You can install any official package with
pacstrapbut this is not recommended.
First lets geneate the fstab file. The fstab file is a file that contains the information about mounted drives and partitions. You can configure the file based on UUID (with the -U flag) or baseed on labels (with the -L flag). To generate the file run:
genfstab -L /mnt >> /mnt/etc/fstab
You have to run this command (
genfstab -L / >> /etc/fstabif already in your system) after adding another mounted drive to your system in order to be persistent after boot.
You can then check the file (/mnt/ect/fstab) in order to see if there is any error.
Now change root into your system by running:
arch-chroot /mnt
This means that you are now under your system (previously /mnt) instead of the live system.
The time zone can be set with:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
For example, for Lisbon, Portugal:
ln -sf /usr/share/zoneinfo/Europe/Lisbon /etc/localtime
Now to generate /etc/adjtime:
hwclock --systohc
This command assumes the hardware clock is set to UTC.
To set the locales you need to uncomment the needed loacles in /etc/locale.gen. You can do this with:
nano /etc/locale.gen
and erasing the '#' before the desired locales. In my case it would look something like this:
#aa_DJ.UTF-8 UTF-8 #aa_DJ.UTF-8 UTF-8 ... #en_SG ISO-8859-1 en_US.UTF-8 UTF-8 #en_US. ISO-8859-1 ... #pt_BR ISO-8859-1 pt_PT.UTF-8 UTF-8 #pt_PT ISO-8859-1 ... #zu_ZA.UTF-8 UTF-8 #zu_ZA ISO-8859-1
Then run:
locale-gen
To set the variables according to your locales you need to edit at least the LANG variable in /etc/locale.conf. Once again, you can do this with:
nano /etc/locale.conf
and it should at least look like this:
LANG=en_US.UTF-8
More complex files can look, for example, like this:
LANG=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LANGUAGE=en_US.UTF-8 LC_TIME=pt_PT.UTF-8 LC_MEASUREMENT=pt_PT.UTF-8 LC_ADDRESS=pt_PT.UTF-8 LC_TELEPHONE=pt_PT.UTF-8 LC_MONETARY=pt_PT.UTF-8 LC_NUMERIC=pt_PT.UTF-8 LC_PAPER=pt_PT.UTF-8
To make your keyboard layout persistent edit /etc/vconsole.conf with:
nano /etc/vconsole.conf
To look like this:
KEYMAP=pt-latin9
This change won't do anything in graphical environments. This only applies to the TTY. (Not even terminal emulators)
Create the hostname (name of your host) file:
nano /etc/hostname
with the name of your host:
myhostname
and match the entries to hosts:
nano /etc/hosts
127.0.0.1 localhost ::1 localhost 127.0.1.1 myhostname.localdomain myhostname
A permanent IP address should replace 127.0.1.1 in case there is one configured.
Usually this is not required since
mkinitcpiowas run on installation of linux withpacstrap.
If you have a custom system (RAID, LVM, ...), modify mkinitcpio.conf and run:
mkinitcpio -p linux
To set the root password run:
passwd
There are several boot loaders. This guide uses systemd-boot since it's already installed.
To install run:
bootctl --path=/boot install
To configure you have to create/edit /boot/loader/loader.conf and then add the entries necessary.
First:
nano /boot/loader/loader.conf
default arch timeout 0 console-mode max
And finally:
nano /boot/loader/entries/arch.conf
title Arch Linux linux /vmlinuz-linux initrd /intel-ucode.img initrd /initramfs-linux.img options root=LABEL=YourRootLabel rw quiet loglevel=3 vga=current