2021-02-12 13:23:55 +01:00
|
|
|
h1 Simple, modern and secure installation of Arch Linux with KDE Plasma.
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Load the preferred keyboard. In my case it's "de" for Germany._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ loadkeys de
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _List devices to make sure you partition the right device._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ lsblk
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Partition the device using gdisk (assuming /dev/sda)._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ gdisk /dev/sda
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Create GPT and EFI-partion._
|
|
|
|
$ 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"._
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Print and check your partitions._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ p
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Write partitions to device._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ w
|
2021-02-12 13:23:55 +01:00
|
|
|
$ y # _Accept._
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Encrypt primary partition._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ cryptsetup -c aes-xts-plain -y -s 512 luksFormat /dev/sda2
|
|
|
|
$ YES
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Open encrypted partition, map as "root" and create filesystem._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ cryptseup luksOpen /dev/sda2 root
|
|
|
|
$ mkfs.fat -F 32 -n UEFI /dev/sda1
|
2021-02-12 13:23:55 +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"._
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Create ext4 filesystem on primary partition._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ mkfs.ext4 /dev/mapper/root
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Create mountpoints and mount partitions._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ mount /dev/mapper/root /mnt
|
|
|
|
$ mkdir /mnt/boot
|
|
|
|
$ mount /dev/sda1 /mnt/boot
|
|
|
|
|
2021-02-12 13:23:55 +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._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ reflector --verbose --latest 10 --country Germany --age 24 --sort rate --save /etc/pacman.d/mirrorlist
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Install base system and basic packages (network, editor, sudo)._
|
|
|
|
# _The package base-devel is not necessary but recommended._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ pacstrap /mnt base base-devel linux linux-firmware networkmanager nano sudo
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Generate fstab._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ genfstab -Lp /mnt > /mnt/etc/fstab
|
2021-02-12 13:23:55 +01:00
|
|
|
# _-L = Use labels for source identifiers (shortcut for -t LABEL)._
|
|
|
|
# _-p Exclude pseudofs mounts (default behavior)._
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Chroot into your installation._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ arch-chroot /mnt
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Set your hostname._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ echo mycomputer > /etc/hostname
|
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Generate locale.gen for your preferred language (and preferribly english)._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ nano /etc/locale.gen
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Uncomment your language, e.g. de_DE.UTF-8 UTF-8 (and en_US.UTF-8)._
|
2021-01-27 13:54:38 +01:00
|
|
|
|
2021-02-12 13:23:55 +01:00
|
|
|
# _Generate the locale._
|
2021-01-27 13:54:38 +01:00
|
|
|
$ locale-gen
|
|
|
|
|
|
|
|
# Add necessary HOOKS and MODULES.
|
|
|
|
$ nano /etc/mkinitcpio.conf
|
|
|
|
|
|
|
|
# MODULES=(ext4)
|
|
|
|
# HOOKS=(base udev autodetect modconf block keyboard keymap encrypt filesystems fsck shutdown)
|
|
|
|
|
|
|
|
# Create mkinitcpio.
|
|
|
|
$ mkinitcpio -p linux
|
|
|
|
|
|
|
|
# Start NetworkManager for automatic network access on next boot.
|
|
|
|
$ systemctl enable NetworkManager
|
|
|
|
|
|
|
|
# Set a root-password.
|
|
|
|
$ passwd
|
|
|
|
|
|
|
|
# Install systemd-boot bootloader.
|
|
|
|
$ bootctl install
|
|
|
|
|
|
|
|
# Create the bootloader config.
|
|
|
|
$ nano /bootloader/entries/arch.conf
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
# 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:
|
|
|
|
# title Arch Linux Fallback
|
|
|
|
# initrd /initramfs-linux-fallback.img
|
|
|
|
|
|
|
|
# Edit loader config.
|
|
|
|
$ nano /boot/loader/loader.conf
|
|
|
|
|
|
|
|
Change it to the following:
|
|
|
|
# timeout 1
|
|
|
|
# default arch.conf
|
|
|
|
|
|
|
|
# Exit and reboot
|
|
|
|
$ exit
|
|
|
|
$ umount /mnt/boot
|
|
|
|
$ reboot
|
|
|
|
|
|
|
|
# Enter encryption-password and login as root.
|
|
|
|
|
|
|
|
# Set the keyboard to your preferred language permantently.
|
|
|
|
$ echo KEYMAP=de-latin1-nodeadkeys > /etc/vconsole.conf
|
|
|
|
|
|
|
|
# Create a user with a /home-directory.
|
|
|
|
$ useradd -m myusername
|
|
|
|
|
|
|
|
# Set password for your user.
|
|
|
|
$ passwd myusername
|
|
|
|
|
|
|
|
# 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“
|
|
|
|
|
|
|
|
# Logout as root.
|
|
|
|
$ exit
|
|
|
|
|
|
|
|
# Login as you user.
|
|
|
|
|
|
|
|
# Install SDDM and a minimal KDE Plasma.
|
|
|
|
$ pacman -S sddm sddm-kcm plasma-desktop
|
|
|
|
|
|
|
|
# Install KDE terminal for easier installation of packages in Plasma.
|
|
|
|
$ pacman -S konsole
|
|
|
|
|
|
|
|
# Enable and start SDDM to login to Plasma.
|
|
|
|
$ systemctl enable sddm
|
|
|
|
$ systemctl start sddm
|
|
|
|
|
|
|
|
# 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)
|