{"id":16761816,"url":"https://github.com/angristan/arch-linux-install","last_synced_at":"2025-03-16T10:14:40.827Z","repository":{"id":153244682,"uuid":"151975190","full_name":"angristan/arch-linux-install","owner":"angristan","description":"My Arch Linux installation notes","archived":false,"fork":false,"pushed_at":"2020-02-12T17:43:43.000Z","size":33,"stargazers_count":87,"open_issues_count":1,"forks_count":23,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-15T15:45:00.112Z","etag":null,"topics":["arch-linux","systemd"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/angristan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"patreon":"angristan","liberapay":"angristan","ko_fi":"angristan"}},"created_at":"2018-10-07T19:01:13.000Z","updated_at":"2025-02-23T23:22:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"91488c36-a8f0-4859-93cd-394f1e6dc1b1","html_url":"https://github.com/angristan/arch-linux-install","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Farch-linux-install","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Farch-linux-install/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Farch-linux-install/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/angristan%2Farch-linux-install/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/angristan","download_url":"https://codeload.github.com/angristan/arch-linux-install/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243852504,"owners_count":20358272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux","systemd"],"created_at":"2024-10-13T04:43:31.967Z","updated_at":"2025-03-16T10:14:40.796Z","avatar_url":"https://github.com/angristan.png","language":null,"funding_links":["https://patreon.com/angristan","https://liberapay.com/angristan","https://ko-fi.com/angristan"],"categories":[],"sub_categories":[],"readme":"# Arch Linux installation guide\n\n## Introduction\n\nThese are my notes on installing [Arch Linux](https://www.archlinux.org/). This is not meant to be a universal guide, but only how I like to setup Arch Linux on my workstations. Since other people might find it useful, I decided to publish it.\n\nHere is the setup I use:\n\n- UEFI\n- systemd-boot\n- LVM on LUKS, plain `/boot`\n- NetworkManager\n- Xorg\n- KDE / Plasma\n- SDDM\n\nThis is mostly based on the [installation guide](https://wiki.archlinux.org/index.php/Installation_guide). I kept what I needed and added other parts. I made sure to put the links to all the wiki pages that I used. (❤️ Arch Wiki)\n\n## Download the ISO\n\nFirst, download the ISO here https://www.archlinux.org/download/ and burn to a drive or insert it to your VM, and boot on it.\n\n## Inital setup\n\nIf using a French keyboard:\n\n```sh\nloadkeys fr\n```\n\nCheck if system is under UEFI:\n\n```sh\nls /sys/firmware/efi/efivars\n```\n\nConnect to wifi if needed\n\n```sh\nwifi-menu\n```\n\nEnable NTP and set timezone\n\n```sh\ntimedatectl set-ntp true\ntimedatectl set-timezone Europe/Paris\n```\n\n## Disk management\n\n- https://wiki.archlinux.org/index.php/Partitioning\n- https://wiki.archlinux.org/index.php/EFI_system_partition\n\nI will describe below 4 ways of using your disk:\n\n1. Classic, unencrypted partitions\n2. LVM\n3. LUKS + crypttab for the swap\n4. LVM on LUKS\n\nMost people use the 4th one these days.\n\n`cfdisk` is my favorite partitioning ncurses tool.\n\nFor each method, you can launch the tool with:\n\n```sh\ncfdisk /dev/sda\n```\n\nReplace `sda` with your drive. Choose GPT if asked. Create the partitions and label them. Then write and quit.\n\n**The tutorial will assume `/dev/sda` is your drive for the rest of the tutorial**\n\n### Method 1 - \"Classic\" (unencrypted)\n\n#### Partitions\n\n| Partition  | Space  | Type             |\n|------------|--------|------------------|\n| /dev/sda1  | 512M   | EFI System       |\n| /dev/sda2  | xG     | Linux Filesystem |\n| /dev/sda3  | xG     | Linux swap       |\n\n#### File systems\n\n`/` partition:\n\n```sh\nmkfs.ext4 /dev/sda2\nmount /dev/sda2 /mnt\n```\n\n`/boot` partition:\n\n```sh\nmkfs.fat -F32 /dev/sda1\nmkdir /mnt/boot\nmount /dev/sda1 /mnt/boot\n```\n\n`swap`:\n\n```sh\nmkswap /dev/sda3\nswapon /dev/sda3\n```\n\n### Method 2 - LVM (unecrypted)\n\n- https://wiki.archlinux.org/index.php/LVM\n\n#### Partitions\n\n| Partition  | Space  | Type             |\n|------------|--------|------------------|\n| /dev/sda1  | 512M   | EFI System       |\n| /dev/sda2  | xG     | Linux Filesystem |\n\n\n#### LVM\n\nCreate the physical volume:\n\n```sh\npvcreate /dev/sda2\n```\n\nThen the volume group:\n\n```sh\nvgcreate vg0 /dev/sda2\n```\n\nThen the logical volumes:\n\n```sh\nlvcreate -L xG vg0 -n swap\nlvcreate -l 100%FREE vg0 -n root\n```\n\n#### File systems\n\n`/` partition:\n\n```sh\nmkfs.ext4 /dev/vg0/root\nmount /dev/vg0/root /mnt\n```\n\n`/boot` partition:\n\n```sh\nmkfs.fat -F32 /dev/sda1\nmkdir /mnt/boot\nmount /dev/sda1 /mnt/boot\n```\n\n`swap`:\n\n```sh\nmkswap /dev/vg0/swap\nswapon /dev/vg0/swap\n```\n\n### Method 3 - LUKS + crypttab\n\n#### Partitions\n\n| Partition  | Space  | Type             |\n|------------|--------|------------------|\n| /dev/sda1  | 512M   | EFI System       |\n| /dev/sda2  | xG     | Linux Filesystem |\n| /dev/sda3  | xG     | swap             |\n\n#### LUKS\n\n- https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Simple_partition_layout_with_LUKS\n\nPrepare the encrypted container:\n\n```sh\ncryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --key-size 512 /dev/sda2\ncryptsetup open /dev/sda2 cryptroot\n```\n\n#### File systems\n\n`/`:\n\n```sh\nmkfs.ext4 /dev/mapper/cryptroot\nmount /dev/mapper/cryptroot /mnt\n```\n\n`/boot`:\n\n```sh\nmkfs.fat -F32 /dev/sda1\nmkdir /mnt/boot\nmount /dev/sda1 /mnt/boot\n```\n\n#### Encrypted swap\n\n- https://wiki.archlinux.org/index.php/Dm-crypt/Swap_encryption#UUID_and_LABEL\n\nThis setup will use `crypttab` to initalize a swap parition on `/dev/sda2`, encrypted with a key from `/dev/urandom`, upon each boot.\n\nThus, when the machine is shutdown, the key is lost and the content of the swap partition can't be read.\n\nAs usual, we want to use UUID since they are safer to use than their `/dev` mappings. Also, the partition will be wiped upon each reboot so it's very important to make sure the same partition is always used.\n\nSince it will be wiped, we can't use a UUID or a label to identify it. Except if we create a tiny, empty file system with a label and then define an offset in `crypttab`.\n\nAfter pacstraping the system and entering `arch-root`:\n\n```sh\nmkfs.ext2 -L cryptswap /dev/sda3 1M\n```\n\n`/etc/crypttab`:\n\n```\nswap LABEL=cryptswap /dev/urandom swap,offset=2048,cipher=aes-xts-plain64,size=512\n```\n\n`/etc/fstab`:\n\n```\n/dev/mapper/swap none swap defaults 0 0\n```\n\n### Method 4 - LVM on LUKS\n\n- https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#LVM_on_LUKS\n\n#### Partitions\n\n| Partition  | Space  | Type             |\n|------------|--------|------------------|\n| /dev/sda1  | 512M   | EFI System       |\n| /dev/sda2  | xG     | Linux Filesystem |\n\n#### LUKS\n\n```sh\ncryptsetup luksFormat --type luks2 --cipher aes-xts-plain64 --key-size 512 /dev/sda2\ncryptsetup open /dev/sda2 cryptlvm\n```\n\n#### LVM\n\nCreate the physical volume:\n\n```sh\npvcreate /dev/mapper/cryptlvm\n```\n\nThen the volume group:\n\n```sh\nvgcreate vg0 /dev/mapper/cryptlvm\n```\n\nThen the logical volumes:\n\n```sh\nlvcreate -L xG vg0 -n swap\nlvcreate -l 100%FREE vg0 -n root\n```\n\n#### File systems\n\n`/` partition:\n\n```sh\nmkfs.ext4 /dev/vg0/root\nmount /dev/vg0/root /mnt\n```\n\n`/boot` partition:\n\n```sh\nmkfs.fat -F32 /dev/sda1\nmkdir /mnt/boot\nmount /dev/sda1 /mnt/boot\n```\n\n`swap`:\n\n```sh\nmkswap /dev/vg0/swap\nswapon /dev/vg0/swap\n```\n\n## Install system\n\nInstall the base packages:\n\n```sh\npacstrap /mnt base base-devel linux linux-firmware\n```\n\n## System setup\n\nGenerate partition table:\n\n```sh\ngenfstab -U /mnt \u003e /mnt/etc/fstab\n```\n\nEnter the chroot:\n\n```sh\narch-chroot /mnt\n```\n\nSet timezone and sync clock:\n\n```sh\nln -sf /usr/share/zoneinfo/Europe/Paris /etc/localtime\nhwclock --systohc\n```\n\nSee https://wiki.archlinux.org/index.php/Locale\n\nUncomment `en_US.UTF-8 UTF-8` (and `fr_FR.UTF-8 UTF-8` if needed) in `/etc/locale.gen`.\n\nGenerate locales:\n\n```sh\nlocale-gen\n```\n\nSet default locale:\n\n```sh\necho \"LANG=en_US.UTF-8\nLC_COLLATE=C\" \u003e /etc/locale.conf\n```\n\nSet keymap to French (if needed):\n\n```sh\necho \"KEYMAP=fr-latin9\" \u003e /etc/vconsole.conf\n```\n\nSet hostname:\n\n```sh\necho \"arch\" \u003e /etc/hostname\n```\n\nSet hosts file:\n\n```sh\necho \"127.0.0.1 localhost\n::1 localhost\n127.0.1.1 arch.localdomain arch\" \u003e\u003e /etc/hosts\n```\n\nSet root password:\n\n```sh\npasswd\n```\n\n## Initial ramdisk\n\n- https://wiki.archlinux.org/index.php/Dm-crypt/Encrypting_an_entire_system#Configuring_mkinitcpio\n- https://wiki.archlinux.org/index.php/Mkinitcpio\n\nThe `HOOKS` line might need to be updated in `/etc/mkinitcpio.conf` depending on the disk method you used:\n\n- Method 1: nothing to change\n- Method 2: `base systemd udev autodetect modconf block sd-lvm2 filesystems keyboard fsck`\n- Method 3: `base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems fsck`\n- Method 4: `base systemd udev autodetect keyboard sd-vconsole modconf block sd-encrypt sd-lvm2 filesystems fsck`\n\nGenerate the ramdisks using the presets:\n\n```sh\nmkinitcpio -P\n```\n\n## Bootloader: systemd-boot\n\n- https://wiki.archlinux.org/index.php/Systemd-boot\n- https://bbs.archlinux.org/viewtopic.php?id=230911\n\nSince we're using `/boot/`, no need to use `--path` option.\n\n```sh\nbootctl install\n```\n\n`/boot/loader/entries/arch.conf` :\n\n```\ntitle Arch Linux\nlinux /vmlinuz-linux\ninitrd /initramfs-linux.img\noptions ...\n```\n\nThe `options` line depends on the disk method you used.\n\n- Method 1: `options root=UUID=$(blkid -s UUID -o value /dev/sda2) rw`\n- Method 2: `options root=/dev/vg0/root rw`\n- Method 3: `options rd.luks.name=$(blkid -s UUID -o value /dev/sda3)=cryptroot root=/dev/mapper/cryptroot rw`\n- Method 4: `options rd.luks.name=$(blkid -s UUID -o value /dev/sda3)=cryptlvm root=/dev/vg0/root rw`\n\n## Intel Microcode\n\n- https://wiki.archlinux.org/index.php/Microcode\n\n```sh\npacman -S intel-ucode\n```\n\nAdd `initrd /intel-ucode.img` above `initrd /initramfs-linux.img` in `/boot/loader/entries/arch.conf`.\n\nCheck after reboot:\n\n```sh\ndmesg -T | grep microcode\n```\n\nUse `amd-ucode` for an AMD CPU.\n\n## Networking: NetworkManager\n\n- https://wiki.archlinux.org/index.php/NetworkManager\n\n```sh\npacman -S networkmanager\nsystemctl enable NetworkManager\nsystemctl start NetworkManager\n```\n\nIf wired with DHCP, nothing more to do.\n\n## Reboot! (if you want)\n\nAs this point, the system should be working and usable, you can reboot. You can also stay in the chroot.\n\n```sh\nexit\numount -R /mnt\n# cryptsetup close {cryptroot,crptlvm}\nreboot\n```\n\n## User account\n\nTo enable sudo access, uncomment this line in `/etc/sudoers`:\n\n```\n%wheel ALL=(ALL) ALL\n```\n\nThe `sudo` group does not exit by default so we'll use `wheel`.\n\nAdd user:\n\n```sh\nuseradd -m -g wheel -c 'Stanislas' -s /bin/bash stanislas\npasswd stanislas\n```\n\n## Xorg\n\n- https://wiki.archlinux.org/index.php/Xorg\n\n```sh\npacman -S xorg-server\npacman -S xf86-video-intel\n```\n\n## Desktop environment: Plasma and KDE\n\n- https://wiki.archlinux.org/index.php/KDE\n\n```sh\npacman -S plasma\npacman -S kde-applications\n```\n\n## Display manager: SDDM\n\n- https://wiki.archlinux.org/index.php/SDDM\n\n```sh\npacman -S sddm\nsystemctl enable sddm\nsystemctl start sddm\n```\n\nBy default, Arch uses the `archlinux-simplyblack` theme, which is ugly. Let's setup `breeze` (the *original* default):\n\n```sh\nmkdir /etc/sddm.conf.d/\necho \"[Theme]\nCurrent=breeze\" \u003e /etc/sddm.conf.d/theme.conf\n```\n\nIf you're not using QWERTY, set the keymap for SDDM with:\n\n```sh\nlocalectl set-x11-keymap fr-latin9\n```\n\nLog back in.\n\n## Fonts\n\n```sh\npacman -S ttf-{bitstream-vera,liberation,freefont,dejavu} freetype2\n```\n\n## yay\n\n- https://wiki.archlinux.org/index.php/AUR_helpers\n- https://github.com/Jguer/yay\n\n`yay` is my current AUR helper.\n\n```sh\ngit clone https://aur.archlinux.org/yay.git\ncd yay\nmakepkg -si\nyay -S yay\n```\n\n## VMware\n\nAs I trained in a VMware Fusion VM, here are some notes.\n\n- https://wiki.archlinux.org/index.php/VMware/Installing_Arch_as_a_guest\n\nInstall `xf86-video-vmware` instead of `xf86-video-intel`. `xf86-input-vmmouse` too.\n\nTo install the VMware tools:\n\n```sh\npacman -S openvpn-vm-tools\nsystemctl enable vmtoolsd\nsystemctl start vmtoolsd\n```\n\n## Now what?\n\nSee https://wiki.archlinux.org/index.php/General_recommendations\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Farch-linux-install","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fangristan%2Farch-linux-install","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fangristan%2Farch-linux-install/lists"}