Forked from mattiaslundberg/arch-linux-install
Last active
December 16, 2019 13:26
-
-
Save jvanveen/d4f858ba5e23b0fddacf68805d5fbef4 to your computer and use it in GitHub Desktop.
Arch linux install on UEFI laptop with LUKS encryption & KDE plasma
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://ftp.nluug.nl/os/Linux/distr/archlinux/iso/2019.12.01/archlinux-2019.12.01-x86_64.iso | |
# Write image to a usb-drive | |
dd if=archlinux-2019.12.01-x86_64.iso of=/dev/sda bs=4M status=progress oflag=sync | |
# Disable secure boot in BIOS. Switch to AHCI if SCSI is enabled. | |
# Boot from USB. | |
# This assumes a wifi only system... | |
wifi-menu | |
# Create partitions | |
cgdisk /dev/nvme0n1 | |
1 256M EFI partition # Hex code ef00 | |
2 100% size partiton # Hex code 8300 | |
mkfs.vfat -F32 /dev/nvme0n1p1 | |
mkfs.ext4 /dev/nvme0n1p2 | |
# Setup the encryption of the system | |
cryptsetup -v luksFormat /dev/nvme0n1p2 | |
cryptsetup luksOpen /dev/nvme0n1p2 root | |
# Create filesystems on encrypted partitions | |
mkfs.ext4 /dev/mapper/root | |
# Mount the new system | |
mkdir mnt | |
mount /dev/mapper/root mnt | |
mkdir mnt/boot | |
mount /dev/nvme0n1p1 mnt/boot | |
pacstrap mnt base base-devel zsh vim git efibootmgr dialog wpa_supplicant netctl dhcpcd ntp | |
genfstab -pU mnt >> mnt/etc/fstab | |
# Change relatime on /dev/mapper/root to noatime (reduces wear if using an SSD) | |
arch-chroot mnt | |
# Setup system clock | |
ln -s /usr/share/zoneinfo/Europe/Stockholm /etc/localtime | |
ntpd -qg | |
hwclock --systohc --utc | |
echo MYHOSTNAME > /etc/hostname | |
echo LANG=en_US.UTF-8 >> /etc/locale.conf | |
echo LANGUAGE=en_US >> /etc/locale.conf | |
echo LC_ALL=C >> /etc/locale.conf | |
vim /etc/locale.gen | |
# Decomment en_US* | |
locale-gen | |
# Set password for root | |
passwd | |
# Add personal user | |
useradd -m -g users -G wheel -s /bin/zsh <USERNAME> | |
passwd <USERNAME> | |
# Move a local mirror to the top. | |
vim /etc/pacman.d/mirrorlist | |
pacman -S linux linux-firmware syslinux plasma-desktop sddm xorg zsh | |
# Configure mkinitcpio: | |
# Add 'encrypt' before filesystems | |
vim /etc/mkinitcpio.conf | |
# Regenerate initrd image | |
mkinitcpio -p linux | |
mkdir -p /boot/EFI/syslinux | |
cp -R /usr/lib/syslinux/efi64/* /boot/EFI/syslinux | |
efibootmgr --create --disk /dev/nvme0n1p1 --loader /EFI/syslinux/syslinux.efi --label "Syslinux" --verbose | |
cp /boot/syslinux/syslinux.cfg /boot/EFI/syslinux | |
vim /boot/EFI/syslinux/syslinux.cfg | |
# LINUX ../../vmlinuz-linux | |
# APPEND root=/dev/mapper/root cryptdevice=/dev/nvme0n1p2:root rw | |
# INITRD ../../initramfs-linux.img | |
exit | |
umount -R /mnt | |
reboot | |
# Test sddm. When everything is ok, enable the service on boot with "systemctl enable sddm" | |
systemctl start sddm | |
# Install daily used software | |
pacman -S konsole chromium code firefox docker docker-compose networkmanager kate gwenview dolphin unzip ark kcalc kwalletmanager | |
pacman -S plasma-nm plasma-wayland-session kscreen breeze-gtk plasma-browser-integration plasma-pa user-manager plasma-vault powerdevil | |
pacman -S sddm-kcm gimp blender inkscape bluez | |
git clone https://aur.archlinux.org/yay.git | |
cd yay | |
makepkg -si |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment