Install Arch Linux via commandline interface

Because I need this from time to time and I find this not interesting enough to remember it, I'll leave it here.

Previously, I kept it in my Dropbox/Documents folder.

Essentials

First of all, make sure you have disabled Secure Boot and enabled Legacy Boot in your BIOS.

Configure Disk with cfdisk

When asked if you want to use GPT, or DOS or whatever else.. CHOOSE DOS, or you will be screwed.

Usually, you'd start cfdisk like so

cfdisk /dev/sda

But as it turns out, some fucking laptops have a device called somewhat like nvme0n1, which resulted in 3+ wasted hours of ours, because I was a dumbfuck and did not simply check lsblk (list block devices).

So in this case, you have to start cfdisk like this

cfdisk /dev/nvme0n1

I prefer to make three partitions: - a boot one (I tend to make it 1GiB), - a root one (I prefer to have it equal the remaining space - swap size) and - a swap one (with increasing amounts of RAM this isn't really a big deal, but I like to have it anyways. Make it 8 GB and you're good).

Partition the first one as bootable HPFS/NTFS/exFAT.

Then partition the second one (the root one) as Linux filesystem, and the last partition (the swap one) will be also Linux filesystem.

Then write the changes and exit cfdisk.

Format Disk

Keep in mind that you might not have sdaX, but nvme0n1pX

mkfs.ntfs /dev/sda1
mkfs.ext4 /dev/sda2
mkswap /dev/sda3

Mounting

Mount the boot and root partition

mount /dev/sda2 /mnt

Base installation and setup

Install base and base-devel tools (install all by default)

pacstrap -i /mnt base base-devel

Generate the mountpoint in fstab

genfstab -U -p /mnt : sed 'ss/rw,realtime,data=ordered/defaults,realtime/' >> /mnt/etc/fstab

Chroot into mnt and setup some basics

arch-chroot /mnt

Uncomment your desired language. For me, that's en_US.UTF-8, en_GB.UTF-8 and also the ISO ones.

vi /etc/locale.gen

Generate language files

locale-gen

Put your desired language in the locale.conf file and export the default language

echo LANG=en_US.UTF-8 > /etc/locale.conf
echo LC_TIME="en_GB.UTF-8" >> /etc/locale.conf
echo LC_PAPER="en_GB.UTF-8" >> /etc/locale.conf
echo LC_MEASUREMENT="en_GB.UTF-8" >> /etc/locale.conf
export LANG=en_US.UTF-8

Enable the DHCP daemon

systemctl enable dhcpcd.service

Enable multilib repo in pacman config (uncomment multilib and save)

vi /etc/pacman.conf

Generate userspace for loading kernel modules and stuff

mkinitcpio -p linux

Change password for the root user

passwd

Setup default user

useradd -m -g users -G wheel -s /bin/bash marco && passwd marco

Synchronize pacman and setup boot-loader

pacman -Syy && pacman -S grub-bios os-prober
grub-install /dev/sda
grub-mkconfig -o /boot/grub/grub.cfg

Exit chroot and reboot

exit
reboot

Extras

Install a graphical UI and superuser tools

pacman -S sudo xorg xorg-xinit gnome gnome-shell git wget openssh bash-completion tmux keepassxc exa xclip rxvt-unicode unzip p7zip unrar nemo-fileroller gnupg

Enable GDM Service

systemctl enable gdm.service

yay (Yet another Yogurt - An AUR Helper written in Go)

git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si
# Cleanup
cd .. && rm -rf yay

Configure sudo

visudo

I like to grant all users of the group wheel access without prompting them to enter their passwords, but choose as you like.

LOGIN AS NORMAL USER - IN THIS CASE MARCO

Clone my dotfiles

mkdir -p ~/Code/marco && cd $_ && git clone https://git.superevilmegaco.com/marco/dotfiles
cd dotfiles && git submodule init && git submodule update && cd

Install Neovim

yay -S neovim-git

Install Python and Neovim's Python modules

yay -S python python2 python-pip python2-pip
pip install neovim
pip2 install neovim

Install Ruby and its Version Manager

yay -S ruby
curl -L get.rvm.io > rvm-install && bash < ./rvm-install
# Cleanup
rm rvm-install

After the script has finished, then add the following line to the end of your ~/.bash_login or ~/.bashrc (or ~/.zprofile or whatever)

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

Now, close out your current shell or terminal session and open a new one. You may attempt reloading your ~/.bashrc with the following command:

source .bashrc

Then install Neovim's Ruby Module globally (and some other awesome gems)

rvm @global do gem install serve &&\
rvm @global do gem install neovim

Clone setup my neovimfiles

wget --no-check-certificate -qO- https://git.superevilmegaco.com/marco/neovimfiles/raw/master/update.bash | bash

Install NodeJS

yay -S nodejs

Check Neovim health with :HealthCheck in Neovim.

Make it beautiful

We need the following packages to make Gnome sexy as hell:

yay -S google-chrome chrome-gnome-shell-git gnome-tweak-tool arc-gtk-theme numix-circle-icon-theme-git powerline-fonts-git exo

I also like to have the minimize and maximize buttons on my windows, so I fire up the Gnome Tweak Tool -> Windows -> Titlebar Buttons -> Tick Maximize and Minimize.

Under appearance I also check the Global Dark Theme tick-box.

For the themes I go with this configuration:

Gnome Terminal

To make Gnome-Terminal look really awesome, check out the Gnome Terminal - One Dark Theme.

And these Gnome extensions

For Chrome, you'll also need the GNOME Shell integration extension.

Import PGP Keys

I prefer to sign my Git commits and therefore I need to import my PGP keys. I have them in my Dropbox and also in my Keybase.io account.

I usually download them (the private ones) from via my keybase account and then I import them.

gpg --import --pinentry-mode loopback keybase-private.key

The next time I do a Git commit, a prompt will ask me for my private key password, which I enter via my KeepassXC Password Manager (I also check the save this password tick-box).

Default applications

Run exo-preferred-applications in the Gnome-Terminal and select your preferred applications (hint: it is Nautilus for your default file-manager and Google Chrome for your default browser!!!).

Nvidia Graphics Card

If you happen to have a Nvidia Graphics Card that causes Gnome to freeze with the Nouveau Open-Source Drivers (like me), you'd better install the proprietary drivers, because they tend to work flawless (until you upgrade your kernel and then everything goes to hell).

Because I cannot recall what model I have, I have to look it up (every single time..).

sudo update-pciids
# Look for Nvidia GT...
lspci -v | less

Then I head over to the Nvidia Drivers Download Page and select the appropriate one.

Then I disable the GDM Service and reboot

sudo systemctl disable gdm.service && sudo reboot

I log in as root and make the installer executable and run it. The first time it fails, because the nouveau drivers are still loaded, but it'll ask you, if you want to blacklist the nouveau drivers, which I answer with of course, yes.

Then I simply reboot, run the installer again and everything should work as expected.

Re-Enable the GDM Service and reboot

systemctl enable gdm.service && reboot

This is it.