Arch-Linux-Installer/install.md

216 lines
6.4 KiB
Markdown
Raw Normal View History

2022-01-12 15:54:51 +01:00
# Simple, modern and secure installation of Arch Linux with KDE Plasma.
2022-01-12 17:19:24 +01:00
_If you won't run into any issues, this should take you under an hour from nothing to a graphical interface. Good luck!_
2022-01-12 15:53:54 +01:00
2022-01-12 15:57:51 +01:00
**Load the preferred keyboard. In my case it's "de" for Germany.**
2022-01-12 16:04:21 +01:00
$ loadkeys de
**List devices to make sure you partition the right device.**
$ lsblk
**Partition the device using gdisk (assuming /dev/sda).**
$ gdisk /dev/sda
**Create GPT and EFI-partion.**
2022-01-12 16:09:19 +01:00
_# Creates new GPT-partition table._
2022-01-12 16:08:40 +01:00
$ o
2022-01-12 16:09:19 +01:00
_# Accept._
2022-01-12 16:08:01 +01:00
$ y
2022-01-12 16:43:00 +01:00
_# Create a new partition, accept default partition number 1 and first sector._
2022-01-12 16:08:01 +01:00
$ n
2022-01-19 20:47:12 +01:00
$ y
$ y
2022-01-12 16:43:00 +01:00
_# Enter partition size (second sector), 512 MB should be plenty for /boot and accept._
2022-01-12 16:08:01 +01:00
$ +512M
2022-01-12 16:09:19 +01:00
_# Mark as EFI._
2022-01-12 16:08:01 +01:00
$ ef00
2022-01-12 16:09:19 +01:00
_# New main partition, accept all the following using "y"._
2022-01-12 16:08:01 +01:00
$ n
2022-01-12 16:06:42 +01:00
2022-01-12 16:43:00 +01:00
**Print and check your partitions. There should be a 512 MiB EFI system partition and a Linux filesystem filling up the rest of the space**
2022-01-12 16:04:21 +01:00
$ p
**Write partitions to device.**
$ w
2022-01-12 16:09:19 +01:00
_# Accept._
$ y
2022-01-12 16:04:21 +01:00
**Encrypt primary partition.**
$ cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
$ YES
2022-01-12 16:43:00 +01:00
**Open encrypted partition and mount to container "lvm".**
$ cryptsetup luksOpen /dev/vda2 lvm
**Create LVM physical volume.**
$ pvcreate /dev/mapper/lvm
2022-01-12 16:04:21 +01:00
2022-01-12 16:43:00 +01:00
**Create LVM volume group called "main".**
$ vgcreate main /dev/mapper/lvm
**Create LVM logical volumes for /root and /home.
Your root volume should be 25-50 GB big, your home volume takes up the remaining space.**
$ lvcreate -L 25G -n root main
$ lvcreate -l 100%FREE -n home main
2022-01-12 16:58:49 +01:00
**Create the filesystems and mount your volumes.**
2022-01-12 16:04:21 +01:00
$ mkfs.fat -F 32 -n UEFI /dev/sda1
2022-01-19 20:41:15 +01:00
_-F specifies the type of file allocation tables used (12, 16 or 32 bit).
-n sets the volume name (label) of the filesystem to "UEFI"._
2022-01-12 16:04:21 +01:00
2022-01-12 16:58:49 +01:00
**Create ext4 filesystem on root and home volumes.**
$ mkfs.ext4 -L root /dev/mapper/main-root
$ mkfs.ext4 -L home /dev/mapper/main-home
2022-01-12 16:04:21 +01:00
**Create mountpoints and mount partitions.**
2022-01-12 16:58:49 +01:00
$ mount /dev/mapper/main-root /mnt
2022-01-12 16:04:21 +01:00
$ mkdir /mnt/boot
2022-01-12 16:58:49 +01:00
$ mkdir /mnt/home
$ mount /dev/sda1 /mnt/boot
$ mount /dev/mapper/main-home /mnt/home
2022-01-12 16:04:21 +01:00
**Optionally update mirrorlist using reflector.**
2022-01-19 20:41:15 +01:00
_In this case use the latest 10 mirrors from Germany, that have been synchronized within the last 24 hours and sort the by download-rate and write them to the pacman mirrorlist._
2022-01-12 16:58:49 +01:00
$ reflector --verbose --latest 10 --country Germany --age 24 --protocol https --sort rate --save /etc/pacman.d/mirrorlist
2022-01-12 16:04:21 +01:00
**Install base system and basic packages (network, editor, sudo).**
**The package base-devel is not necessary but recommended.**
2022-01-12 16:58:49 +01:00
$ pacstrap /mnt base base-devel linux linux-firmware networkmanager nano sudo lvm2
2022-01-12 16:04:21 +01:00
2022-01-19 20:35:46 +01:00
**Optional: install all basic packages for KDE Plasma:**
$ pacstrap /mnt base base-devel linux linux-zen linux-firmware networkmanager nano sudo lvm2 sddm sddm-kcm plasma-desktop konsole firefox
2022-01-12 16:04:21 +01:00
**Generate fstab.**
2022-01-12 16:58:49 +01:00
$ genfstab -Up /mnt > /mnt/etc/fstab
2022-01-19 20:41:15 +01:00
_-U = Use UUID for source identifiers (shortcut for -t LABEL).
2022-01-19 20:47:12 +01:00
-p = Exclude pseudofs mounts (default behavior)._
2022-01-12 16:04:21 +01:00
**Chroot into your installation.**
$ arch-chroot /mnt
**Set your hostname.**
$ echo mycomputer > /etc/hostname
**Generate locale.gen for your preferred language (and preferribly english).**
$ nano /etc/locale.gen
2022-01-19 20:41:15 +01:00
_Uncomment your language, e.g. de_DE.UTF-8 UTF-8 (and en_US.UTF-8)._
2022-01-12 16:04:21 +01:00
**Generate the locale.**
$ locale-gen
**Add necessary HOOKS and MODULES.**
$ nano /etc/mkinitcpio.conf
2022-01-19 20:41:15 +01:00
```
MODULES=(ext4)
HOOKS=(base udev autodetect modconf block keyboard keymap encrypt lvm2 filesystems fsck shutdown)
```
2022-01-12 16:04:21 +01:00
**Create mkinitcpio.**
2022-01-19 20:35:46 +01:00
$ mkinitcpio -p linux-zen
2022-01-12 16:04:21 +01:00
**Start NetworkManager for automatic network access on next boot.**
$ systemctl enable NetworkManager
2022-01-19 20:35:46 +01:00
**Enable SDDM to start on next boot.**
$ systemctl enable sddm
2022-01-12 16:04:21 +01:00
**Set a root-password.**
$ passwd
**Install systemd-boot bootloader.**
$ bootctl install
**Create the bootloader config.**
$ nano /bootloader/entries/arch.conf
**Add the following:**
2022-01-12 16:01:54 +01:00
```
title Arch Linux
2022-01-19 20:35:46 +01:00
linux /vmlinuz-linux-zen
initrd /initramfs-linux-zen.img
2022-01-12 16:58:49 +01:00
options cryptdevice=/dev/sda2:main root=/dev/mapper/main-root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8
2022-01-12 16:01:54 +01:00
```
2022-01-12 16:04:21 +01:00
**Create a fallback config.**
$ cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf
**Edit the fallback config.**
$ nano /boot/loader/entries/arch-fallback.conf
**Change it to the following:**
2022-01-12 16:01:54 +01:00
```
title Arch Linux Fallback
initrd /initramfs-linux-fallback.img
```
2022-01-12 16:04:21 +01:00
**Edit loader config.**
$ nano /boot/loader/loader.conf
**Change it to the following:**
2022-01-12 16:01:54 +01:00
```
timeout 1
default arch.conf
```
2022-01-12 16:04:21 +01:00
2022-01-19 20:41:15 +01:00
**Set your keyboard to your language.**
2022-01-19 20:35:46 +01:00
$ localectl --no-convert set-keymap de-latin1-nodeadkeys
2022-01-19 20:41:15 +01:00
$ localectl --no-convert set-x11-keymap de pc105 deadgraveacute
2022-01-12 16:04:21 +01:00
**Create a user with a /home-directory.**
2022-01-12 17:05:31 +01:00
$ useradd -m $myusername
2022-01-12 16:04:21 +01:00
**Set password for your user.**
2022-01-12 17:05:31 +01:00
$ passwd $myusername
2022-01-12 16:04:21 +01:00
**Add $myusername to group wheel for sudo access.**
$ gpasswd -a $myusername wheel
**Edit sudoers-file for sudo access.**
$ nano /etc/sudoers
**Uncomment „%wheel ALL=(ALL) ALL“.**
2022-01-19 20:41:15 +01:00
**Don't forget to also delete the space between the # and %wheel.**
**Exit and reboot.**
2022-01-12 16:04:21 +01:00
$ exit
2022-01-19 20:41:15 +01:00
$ umount /mnt/boot
$ umount /mnt/home
$ reboot
2022-01-12 16:04:21 +01:00
**Now you are logged in to your Plasma desktop environment and ready to configure and use your Arch Linux.**
**Suggested packages to install.**
2022-01-12 16:01:54 +01:00
- microcode (https://wiki.archlinux.org/index.php/Microcode)
- kde-gtk-config (Adds graphical settings for GTK apps.)
- kdeplasma-addons („All kind of addons to improve your Plasma experience.“)
- kscreen (Adds screen section to graphical settings.)
- ksystemlog (Graphical system log viewer)
- partitionmanager (Graphical partition manager)
- plasma-nm (Network manager applet)
- plasma-pa (Audio manager applet)
- powerdevil (Adds energy manager to graphical settings.)
- spectacle (Graphical screenshot tool.)
2022-01-12 17:17:24 +01:00
- zram-generator (https://wiki.archlinux.org/title/Swap#zram-generator)
- reflector (https://wiki.archlinux.org/title/Reflector)
2022-01-12 17:18:28 +01:00
## Work in progress:
2022-01-12 17:17:24 +01:00
- KDE Connect
- UFW
- BackInTime and/or Timeshift
- breeze-gtk?
- Dolphin and/or Krusader
- Linux-Zen
- Pipewire
- rmtrash
- spectacle
- unrar, rar, zip
- yakuake
2022-01-12 17:18:28 +01:00
## Post installation configuration (WIP) :
2022-01-12 17:17:24 +01:00
- Reflector hook
- Installing yay