This gist contains every step I took to install my fully functional rice. Arch linux will be installed on luks encrypted lvm.
I assume you already have a bootable arch usb and are booted from it. If not, download an arch iso and copy it on to a usb stick with dd (or something like bootiso if you don't trust yourself with dd. (But in that case I do not reccomend installing arch anyway.))
-
first check if we are booted into efi mode
ls /sys/firmware/efi # Check if uefi
if that directory is not empty we are. If it is, then please boot into efi mode. -
before we continue, disable the console beep with
setterm -blenght 0
to keep your sanity and set your keyboard layout to something you are comfortable with with loadkeys, eg.loadkeys uk
for the British layout orloadkeys de-latin1
for the German layout
-
Check which disk you want to install arch on, typically it's going to be something like
/dev/sda
, which this guide will assume you are installing on. If not, substitute /dev/sdaX with the appropriate drive. If you are not sure what the drive you are installing on is called,lsblk
may help you. -
Create the partitions. run
cgdisk /dev/sda
-
Delete all existing partitions, create GPT if necessary
-
Create new partitions
New-> default -> 512M-> ef00 -> bootefi
New-> default -> 100%->8e00-> partarch
Verify
Write
Quit
-
Make efi system fs
mkfs.fat -F32 /dev/sda1
-
setup rootfs
cryptsetup -y -v luksFormat /dev/sda2
cryptsetup open --type luks /dev/sda2 pvarch
pvcreate /dev/mapper/pvarch
vgcreate vgarch /dev/mapper/pvarch
lvcreate -L16G vgarch -n swap
lvcreate -l 100%FREE vgarch -n rootfs
mkfs.ext4 /dev/mapper/vgarch-rootfs
mkswap /dev/mapper/vgarch-swap
swapon /dev/mapper/vgarch-swap
- Check swap space with free -m
- Mount partitions
mount /dev/mapper/vgarch-rootfs /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
-
Update live boot image if necessary
pacman -Syy archlinux-keyring reflector
-
Select a fast mirror. Subsititute your country.
reflector -c "Germany" -f 10 -l 10 --verbose --save /etc/pacman.d/mirrorlist
-
Install basic packages
pacstrap /mnt base base-devel vim networkmanager neovim git zsh pbzip2 pigz lrzip lzop
-
Make FS
genfstab -U /mnt > /mnt/etc/fstab
- specify external drives on boot with /etc/crypttab, like:
pvdata UUID=2f9a8428-ac69-478a-88a2-4aa458565431 none luks,timeout=120
-
chroot into install
arch-chroot /mnt
-
Set time and locales
rm /etc/localtime
ln -s /usr/share/zoneinfo/Europe/Budapest /etc/localtime
hwclock --systohc --utc
vim /etc/locale.gen # Uncomment the locales you want. en_US should be uncommented
locale-gen
locale > /etc/locale.conf
- Set root and user passwords
passwd
useradd -m -s /bin/zsh -r -G wheel xzvf
EDITOR=vim visudo # enable group wheel or user
passwd xzvf
-
Set the default tty layout to the one you prefer
echo 'KEYMAP=uk' > /etc/vconsole.conf
-
GET RID OF THE FUCKING BLEEPS!
echo 'blacklist pcspkr' > /etc/modprobe.d/nobeep.conf
-
Hostname and hosts
echo "beryllium" > /etc/hostname
vim /etc/hosts
- Example hosts file:
127.0.0.1 localhost
127.0.0.1 lithium.periodic.table lithium
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
- Apply some useful settings
vim /etc/makepkg.conf
PKGEXT='.pgk.tar' to remove unnecessary compression
MAKEFLAGS="-j$(nproc)"
COMPRESSGZ=(pigz -c -f -n)
COMPRESSBZ2=(pbzip2 -c -f)
COMPRESSXZ=(xz -c -z - --threads=0)
COMPRESSLRZ=(lrzip -q)
COMPRESSLZO=(lzop -q)
COMPRESSZ=(compress -c -f)
vim /etc/pacman.conf # ILoveCandy \n Color
- Install and configure bootloader
vim /etc/mkinitcpio.conf #
replace the HOOKS with precisely:
HOOKS=(base udev autodetect modconf block keyboard encrypt lvm2 filesystems fsck)
mkinitcpio -p linux
bootctl --path=/boot/ install
echo 'timeout 3'>> /boot/loader/loader.conf
vim /boot/loader/entries/arch.conf
Example config:
title Arch
linux /vmlinuz-linux
initrd /initramfs-linux.img
options cryptdevice=UUID=ee33c343-9873-4726-9b82-6b813780c104:lvarch root=/dev/mapper/vgarch-lvarch quiet rw
Tip: use :read ! blkid /dev/sda2 to get uuid
- Reboot to the install
exit
umount -R /mnt
reboot
- Network
sudo systemctl enable NetworkManager
sudo systemctl start NetworkManager
- Install yay
cd /tmp
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
cd ~
rm /tmp/yay -rf
yay -S yay # Just to have it in yay's cache for future updates
- Install useful programs
yay -S openssh i3-gaps-next-git stow feh compton-tryone-git nvidia nvidia-utils \
cronie polybar alsa-utils pulseaudio firefox-developer-edition chromium code \
python-pip lxappearance vlc nodejs npm rofi dmenu tmux htop gotop iftop w3m ranger \
emacs nerd-fonts-complete mutt-wizard materia-theme stow xorg-apps xorg-xinit \
thefuck neomutt sox i3lock-color-git imagemagick autorandr arandr \
pass browserpass browserpass-firefox browserpass-chrome bat powerline \
pandoc texlive-most texlive-lang biber
-
Activate nvidia driver (reboot may be necessary)
sudo nvidia-modprobe
-
vim /etc/ssh/sshd_config
Set:
PermitRootLogin no
- Start services
sudo systemctl enable sshd
sudo systemctl start sshd
sudo systemctl enable cronie
sudo systemctl start cronie
- Make ssh key
ssh-keygen
- Copy gpg keys from other pc
- On other pc
ssh-copy-id user@ip
scp user@ip:/home/user/.ssh/id_rsa.pub /some/place # To add to github
gpg --export-secret-keys > keyfile
gpg --export-ownertrust > trustfile # copy these two to the other pc
- On current install
gpg --import keyfile
gpg --import-ownertrust trustfile
- Install some python modules
sudo pip install i3ipc fontawesome
- install oh-my-zsh
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
- powerlevel9k
git clone https://github.com/bhilburn/powerlevel9k.git ~/.oh-my-zsh/custom/themes/powerlevel9k
- doom emacs
git clone https://github.com/hlissner/doom-emacs ~/.emacs.d
~/.emacs.d/bin/doom install
- Install my st build
mkdir inst
cd inst
git clone [email protected]/x-zvf/st
cd st/src
sudo make install
- Install rofi theme
cd ../..
git clone https://github.com/0xdec/base16-rofi.git
cd ~
- Clone dotfiles
git clone [email protected]:x-zvf/dotfiles.git
rm .bash* .zshrc
cd dotfiles
stow .
- Add zsh plugins
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# vim plug
curl -fLo ~/.local/share/nvim/site/autoload/plug.vim --create-dirs \
https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
nvim # run :PlugInstall
- log out and back in
- Finally
- Init pass
- set up email
- log in to browsers