Arch-Linux-Installer/README.md

176 lines
4.9 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 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 15:53:54 +01:00
$ loadkeys de
2022-01-12 15:57:32 +01:00
**List devices to make sure you partition the right device.**
2022-01-12 15:53:54 +01:00
$ lsblk
2022-01-12 15:57:32 +01:00
**Partition the device using gdisk (assuming /dev/sda).**
2022-01-12 15:53:54 +01:00
$ gdisk /dev/sda
2022-01-12 16:01:54 +01:00
**Create GPT and EFI-partion.**
2022-01-12 15:53:54 +01:00
$ o # _Creates new GPT-partition table._
$ y # _Accept._
$ n # _New partition._
$ +512M # _512 MB should be plenty for /boot._
$ ef00 # _Mark as EFI._
$ n # _New main partition, accept all the following using "y"._
2022-01-12 16:01:54 +01:00
**Print and check your partitions.**
2022-01-12 15:53:54 +01:00
$ p
2022-01-12 16:01:54 +01:00
**Write partitions to device.**
2022-01-12 15:53:54 +01:00
$ w
$ y # _Accept._
2022-01-12 16:01:54 +01:00
**Encrypt primary partition.**
2022-01-12 15:53:54 +01:00
$ cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
$ YES
2022-01-12 16:01:54 +01:00
**Open encrypted partition, map as "root" and create filesystem.**
2022-01-12 15:53:54 +01:00
$ cryptseup luksOpen /dev/sda2 root
$ mkfs.fat -F 32 -n UEFI /dev/sda1
2022-01-12 16:01:54 +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 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Create ext4 filesystem on primary partition.**
2022-01-12 15:53:54 +01:00
$ mkfs.ext4 /dev/mapper/root
2022-01-12 16:01:54 +01:00
**Create mountpoints and mount partitions.**
2022-01-12 15:53:54 +01:00
$ mount /dev/mapper/root /mnt
$ mkdir /mnt/boot
$ mount /dev/sda1 /mnt/boot
2022-01-12 16:01:54 +01:00
**Optionally update mirrorlist using reflector.**
**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 15:53:54 +01:00
$ reflector --verbose --latest 10 --country Germany --age 24 --sort rate --save /etc/pacman.d/mirrorlist
2022-01-12 16:01:54 +01:00
**Install base system and basic packages (network, editor, sudo).**
**The package base-devel is not necessary but recommended.**
2022-01-12 15:53:54 +01:00
$ pacstrap /mnt base base-devel linux linux-firmware networkmanager nano sudo
2022-01-12 16:01:54 +01:00
**Generate fstab.**
2022-01-12 15:53:54 +01:00
$ genfstab -Lp /mnt > /mnt/etc/fstab
2022-01-12 16:01:54 +01:00
**-L = Use labels for source identifiers (shortcut for -t LABEL).**
**-p Exclude pseudofs mounts (default behavior).**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Chroot into your installation.**
2022-01-12 15:53:54 +01:00
$ arch-chroot /mnt
2022-01-12 16:01:54 +01:00
**Set your hostname.**
2022-01-12 15:53:54 +01:00
$ echo mycomputer > /etc/hostname
2022-01-12 16:01:54 +01:00
**Generate locale.gen for your preferred language (and preferribly english).**
2022-01-12 15:53:54 +01:00
$ nano /etc/locale.gen
2022-01-12 16:01:54 +01:00
**Uncomment your language, e.g. de_DE.UTF-8 UTF-8 (and en_US.UTF-8).**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Generate the locale.**
2022-01-12 15:53:54 +01:00
$ locale-gen
2022-01-12 16:01:54 +01:00
**Add necessary HOOKS and MODULES.**
2022-01-12 15:53:54 +01:00
$ nano /etc/mkinitcpio.conf
2022-01-12 16:01:54 +01:00
**MODULES=(ext4)**
**HOOKS=(base udev autodetect modconf block keyboard keymap encrypt filesystems fsck shutdown)**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Create mkinitcpio.**
2022-01-12 15:53:54 +01:00
$ mkinitcpio -p linux
2022-01-12 16:01:54 +01:00
**Start NetworkManager for automatic network access on next boot.**
2022-01-12 15:53:54 +01:00
$ systemctl enable NetworkManager
2022-01-12 16:01:54 +01:00
**Set a root-password.**
2022-01-12 15:53:54 +01:00
$ passwd
2022-01-12 16:01:54 +01:00
**Install systemd-boot bootloader.**
2022-01-12 15:53:54 +01:00
$ bootctl install
2022-01-12 16:01:54 +01:00
**Create the bootloader config.**
2022-01-12 15:53:54 +01:00
$ nano /bootloader/entries/arch.conf
2022-01-12 16:01:54 +01:00
**Add the following:**
```
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=/dev/sda2:root root=/dev/mapper/root rw lang=de init=/usr/lib/systemd/systemd locale=de_DE.UTF-8
```
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Create a fallback config.**
2022-01-12 15:53:54 +01:00
$ cp /boot/loader/entries/arch.conf /boot/loader/entries/arch-fallback.conf
2022-01-12 16:01:54 +01:00
**Edit the fallback config.**
2022-01-12 15:53:54 +01:00
$ nano /boot/loader/entries/arch-fallback.conf
2022-01-12 16:01:54 +01:00
**Change it to the following:**
```
title Arch Linux Fallback
initrd /initramfs-linux-fallback.img
```
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Edit loader config.**
2022-01-12 15:53:54 +01:00
$ nano /boot/loader/loader.conf
2022-01-12 16:01:54 +01:00
**Change it to the following:**
```
timeout 1
default arch.conf
```
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Exit and reboot.**
2022-01-12 15:53:54 +01:00
$ exit
$ umount /mnt/boot
$ reboot
2022-01-12 16:01:54 +01:00
**Enter encryption-password and login as root.**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Set the keyboard to your preferred language permantently.**
2022-01-12 15:53:54 +01:00
$ echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf
2022-01-12 16:01:54 +01:00
**Create a user with a /home-directory.**
2022-01-12 15:53:54 +01:00
$ useradd -m myusername
2022-01-12 16:01:54 +01:00
**Set password for your user.**
2022-01-12 15:53:54 +01:00
$ passwd myusername
2022-01-12 16:01:54 +01:00
**Add $myusername to group wheel for sudo access.**
$ gpasswd -a $myusername wheel
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Edit sudoers-file for sudo access.**
2022-01-12 15:53:54 +01:00
$ nano /etc/sudoers
2022-01-12 16:01:54 +01:00
**Uncomment „%wheel ALL=(ALL) ALL“-**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Logout as root.**
2022-01-12 15:53:54 +01:00
$ exit
2022-01-12 16:01:54 +01:00
**Login as you user.**
2022-01-12 15:53:54 +01:00
2022-01-12 16:01:54 +01:00
**Install SDDM and a minimal KDE Plasma.**
2022-01-12 15:53:54 +01:00
$ pacman -S sddm sddm-kcm plasma-desktop
2022-01-12 16:01:54 +01:00
**Install KDE terminal for easier installation of packages in Plasma.**
2022-01-12 15:53:54 +01:00
$ pacman -S konsole
2022-01-12 16:01:54 +01:00
**Enable and start SDDM to login to Plasma.**
2022-01-12 15:53:54 +01:00
$ systemctl enable sddm
$ systemctl start sddm
2022-01-12 16:01:54 +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.**
- 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.)
- systemd-swap (https://wiki.archlinux.org/index.php/swap#systemd-swap)