Skip to content

Latest commit

 

History

History
328 lines (234 loc) · 5.33 KB

arch-installation.md

File metadata and controls

328 lines (234 loc) · 5.33 KB

Arch Installation Guide

Basic Setup

Make sure you have an internet connection.

ping 8.8.8.8

Now you can either use the installation script from this repository by cloning it and executing, or simple go through each of the steps.

git clone https://github.com/jmpargana/Dotfiles
./Dotfiles/.scripts/arch-install.sh
  1. Load keyboard layout
loadkeys de-latin1
  1. Update system clock
timedatectl set-ntp true
  1. Create the partitions

A good and simple layout would be: 1. Boot - 512Mb 2. Swap - 8Gb 3. Root - Remaining

  1. Setup the partitions

The -L flag creates a label, which will be usefull later with the booting system.

mkfs.ext4 -L p_arch /dev/nvme0n1p3
mkswap -L p_swap /dev/nvme0n1p2
mkfs.fat -F 32 -n EFIBOOT /dev/nvme0n1p1
  1. Mount the partitions
mount -L p_arch /mnt
swapon -L p_swap
mkdir -p /mnt/boot
mount -L EFIBOOT /mnt/boot
  1. Prepare Mirrors for Germany
cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
grep -E -A 1 ".*Germany.*$" /etc/pacman.d/mirrorlist.bak | sed '/--/d' > /etc/pacman.d/mirrorlist
  1. Install base system
pacstrap /mnt base base-devel linux linux-firmware vim
  1. Other needed packages
pacman --root /mnt -S dhcpcd bash-completion intel-ucode wpa_supplicant netctl dialog efibootmgr dosfstools gptfdisk
  1. Generate fstab
genfstab -Up /mnt > /mnt/etc/fstab
  1. Enter /mnt
arch-chroot /mnt/
  1. Add hostname
echo icm > /etc/hostname
  1. Setup language
echo LANG=en_US.UTF-8 > /etc/locale.conf
#delete line /etc/locale.gen
locale-gen
  1. Keyboard layout
echo KEYMAP=de-latin1 > /etc/vconsole.conf
echo FONT=lat9w-16 >> /etc/vconsole.conf
  1. Datetime
ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime
hwclock --systohc
  1. Setup hosts
echo archlinuxthinkpad > /etc/hostname
cat >> /etc/hosts <<EOF
127.0.0.1   localhost
::1         localhost
127.0.1.1   archlinuxthinkpad.localdomain   archlinuxthinkpad
EOF
  1. Generate initramfs
mkinitcpio -p linux
  1. Create root and user passwd
echo "Type root password:"
passwd
useradd -m -G wheel,storage,power -s /bin/bash icm
echo "Type icm password:"
passwd icm
EDITOR=vim visudo
  1. Automatically update time
systemctl enable --now systemd-timesyncd.service
hwclock -w
  1. Setup Bootloader
bootctl install
cat > /boot/loader/loader.conf <<EOF
default arch-uefi
timeout 0
EOF

cat > /boot/loader/entries/arch-uefi.conf
title   Arch Linux
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux.img
options root=LABEL=p_arch rw resume=LABEL=p_swap quiet loglevel=3 rd.udev.log_priority=3
EOF

cat > /boot/loader/entries/arch-uefi-fallback.conf
title   Arch Linux Fallback
linux   /vmlinuz-linux
initrd  /intel-ucode.img
initrd  /initramfs-linux-fallback.img
options root=LABEL=p_arch rw resume=LABEL=p_swap quiet loglevel=3 rd.udev.log_priority=3
EOF
  1. Exit and reboot
exit
umount -R /mnt
reboot

Post Installation

After you reboot and setup the internet connection again, you can either run the post installation script or setup the next steps one by one:

git clone https://github.com/jmpargana/Dotfiles
./Dotfiles/.scripts/arch-post-install.sh
  1. Get AUR package manager
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
  1. Setup Xorg and WMs

Install all xorg needed

sudo pacman -S xorg-server xorg-xinit xorg-drivers xterm alacritty

Followed by the intel video drivers

sudo pacman -S xf86-video-intel xf86-input-synaptics mesa

Set the keymap in xorg

localectl set-x11-keymap de pc105 nodeadkeys

Install additional fonts

sudo pacman -S ttf-dejavu

Configure sound cards.

sudo pacman -S alsa-utils
gpasswd -a icm audio

Prepare power interface for laptop.

sudo pacman -S acpid
sudo systemctl enable acpid
sudo systemctl start acpid

Finally install all packages for window managers

sudo pacman -S i3status rofi feh openbox ttf-dejavu ttf-liberation ttf-font-awesome
  1. Setup Display Manager
sudo pacman -S lightdm
yay -S lightdm-webkit-theme-aether
sudo systemctl enable lightdm.service
  1. Load Configs and Betterlockscreen

Get all other programs.

sudo pacman -S firefox thunderbird vlc keepassxc telegram-desktop thunar ranger
yay -S spotify

Install zsh or fish.

  1. Basic Programming Packages

The rest should be installed either with a docker container or inside a virtual environment for any given project.

# Python
sudo pacman -S python-pip
pip install --upgrade pip
pip install pipenv

# C++
sudo pacman -S g++ gcc make cmake clang llvm the_silver_searcher dash fzf

# JS
sudo pacman -S nodejs npm yarn

# Latex
sudo pacman -S texlive-most texlive-lang biber

# Rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
  1. Setup Docker
sudo pacman -S docker
sudo systemctl enable docker.service
sudo systemctl start docker.service
groupadd docker
gpasswd -a icm docker
  1. Generate SSH Key

    1. Install openssh
    sudo pacman -S openssh
    1. Generate key
    ssh-keygen -t rsa -b 4096 -C "icmjmp@protonmail.ch"
    1. Add to ssh-agent
    eval "$(ssh-agent -s)"
    ssh-add ~/.ssh/id_rsa
  2. Start Firewall

  3. Install VPN