Aller au contenu
  1. Articles & Tutoriel/

Installation de ArchLinux

·4 mins

N’arrivant pas à trouver une distribution linux suffisamment ouverte pour avoir un grand choix de package et une distrib suffisamment flexible, je préfère utiliser une Archlinux à la fois pour le travail que pour la maison.

Booter sur l’usb #

Désactiver le securboot et activer l’UEFI dans le bios

Keymap #

Par default il est en US pour le passer en FR

loadkeys fr

Connection a internet #

Via ethernet rien a faire. Pour utiliser la wifi quelques commandes:

iwctl
[iwd]# device list
[iwd]# station [device] scan
[iwd]# station [device] get-networks
[iwd]# station [device] connect ssid
[iwd]# station [device] show
[iwd]# exit

Update the system clock #

timedatectl set-ntp true

Partitionnement des disques #

fdisk est déja préinstaller.

Trouver les disques #

lsblk

Ouvrir un device #

J’utilise ici /dev/nvme0n1, en fonction vous pouver avoir /dev/sdX ou autre.

fdisk /dev/nvme0n1

Créer une partion GPT vide #

Command (m for help): g

Created a new GPT disklabel (GUID: 6F3CAE37-9D33-A94A-AB66-B12930CBDD23).

Création de /boot #

On utilisera une partion 1Go.

Command (m for help): n
Partition number (1-128, default 1):
First sector (2048-1953525134, default 2048):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (2048-1953525134, default 1953525134): +1G

Created a new partition 1 of type 'Linux filesystem' and of size 1 GiB.

Création de root #

J’utilise 50Gb pour la partion root en exemple

command (m for help): n
Partition number (2-128, default 2):
First sector (10487807-1953525134, default 10487808):
Last sector, +/-sectors or +/-size{K,M,G,T,P} (10487808-1953525134, default 1953525134): +50G

Created a new partition 2 of type 'Linux filesystem' and of size 50 GiB.

Changer le type de partition #

Afficher les partions

Command (m for help): p
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 960 EVO 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3AF0E18F-10A6-B448-BA5F-F2756905EF13

Device            Start       End   Sectors Size Type
/dev/nvme0n1p1     2048   2099199   2097152   1G Linux filesystem
/dev/nvme0n1p2 10487808  10487807 104857600  50G Linux filesystem

Changer la partition boot pour de l’UEFI

Command (m for help): t
Partition number (1-3, default 3): 1
Partition type or alias (type L to list all): 1

Changed type of partition 'Linux filesystem' to 'EFI System'.

Valider en réaffichant .

Command (m for help): p
Disk /dev/nvme0n1: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: Samsung SSD 960 EVO 1TB
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: 3AF0E18F-10A6-B448-BA5F-F2756905EF13

Device            Start       End   Sectors Size Type
/dev/nvme0n1p1     2048   2099199   2097152   1G EFI System
/dev/nvme0n1p2  2099199 115345407 104857600  50G Linux filesystem

Et terminer en écrivant sur le disque .

Command (m for help): w

Formater les partitions #

Format boot partion #

EFI utilse le fat32

mkfs.fat -F32 /dev/nvme0n1p1

Format root partion #

J’utilise btrfs pour root (label arch-box) vous pouvez utiliser du aussi ext4.

mkfs.btrfs -L arch-box /dev/nvme0n1p2

Monter le système de fichier #

Monter sous /mnt

Monter la partition /root #

mount /dev/nvme0n1p2 /mnt

Monter la partion /boot #

Create and mount /mnt/boot

mkdir /mnt/boot

mount /dev/nvme0n1p1 /mnt/boot

Installation des packages essentiels #

Selectionner intel-ucode ou amd-ucode en fonction de processeur.

pacstrap /mnt base linux linux-firmware btrfs-progs net-tools networkmanager git vim base-devel plasma-desktop konsole dolphin sddm plasma-wayland-session egl-wayland sudo

Strict minimum pour un KDE sous wayland le reste pourra être installer plus tard

Configurer le système #

Générer le fichier fstab #

genfstab -U /mnt >> /mnt/etc/fstab

Le valider et l’éditer si besoin

Chroot - Dans le nouveau système #

arch-chroot /mnt

Définir la timezone #

ln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime

Générer /etc/adjtime #

hwclock --systohc

Localization #

Editer /etc/locale.gen. Décommenter les locale nécéssaire (example fr_FR.UTF-8) et les générer.

locale-gen

Création de la conf /etc/locale.conf et la définir.

LANG=fr_fr.UTF-8

Définir le type de clavier /etc/vconsole.conf.

KEYMAP=fr

La configuration réseau #

Création de /etc/hostname ajouter

arch-box

Le fichier /etc/hosts

127.0.0.1	localhost
::1			localhost
127.0.1.1	arch-box

Générer le nouveau initramfs #

mkinitcpio -P

Définir le password root #

passwd

Création de l’utilisateur dans le groupe sudo (wheel) #

useradd -m -G wheel  toto
passwd toto

Activer les service de base pour le desktop #

systemctl enable sddm NetworkManager

Configurer le bootloader (systemd-boot) #

En premier installer systemd-boot dans la partition /boot.

bootctl install

Création de /boot/loader/loader.conf avec en suivant

default arch.conf
timeout 4
console-mode max
editor no

Création du fichier /boot/loader/entries/arch.conf avec (selectioner intel-ucode ou amd-ucode en fonction de votre proco)

title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
#initrd /amd-ucode.img
initrd  /initramfs-linux.img
options	root="LABEL=arch-box" rw

Redémarrer #

Déconnexion avec CTRL-D

Par sécurité on démonte proprement.

umount -R /mnt

Restart

reboot

Vous pouver enfin profiter de votre Arch neuf 🎉