Installing 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

Configure Disk with cfdisk

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).

Then I format sda2 (the root one) in ext4

mkfs.ext4 /dev/sda2

create the swap one too

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, it's en_US.UTF-8 and also the ISO one.

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 && 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

Package-Query

git clone https://aur.archlinux.org/package-query.git && cd package-query && makepkg -si
cd ..

Yaourt

git clone https://aur.archlinux.org/yaourt.git && cd yaourt && makepkg -si
# Cleanup
cd .. && rm -rf yaourt* package-query*

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://github.com/walialu/dotfiles.git
cd dotfiles && git submodule init && git submodule update && cd

Install Neovim

yaourt -S neovim-git

Install Python and Neovim's Python modules

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

Install Ruby and its Version Manager

yaourt -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://raw.github.com/walialu/neovimfiles/master/update.bash | bash

Install NodeJS

yaourt -S nodejs

Check Neovim health with :HealthCheck in Neovim.

Make it beautiful

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

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

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:

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).

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...
lscpi -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 hell 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.