In this blog post, I show an example end-to-end instructions for setting up an Arch Linux. The instructions are designed for people who want to who want to do minimal Arch Linux installation (as compared to a more heavy-weight bundled installation). Some steps are not required.
- Get a bootable usb
- Boot to arch linux installation drive
- Check the disks
# fdisk -l
- Select the disk we’re going to format and partition
- Select the drive
- Type ’n’ to create a new partition. Choose default settings.
- Type ‘F’ to verify free space.
- Type ’t’ to change partition type to Linux.
- Type ‘w’ to finish.
- To format the partition
# fdisk /dev/nvme1n1p5
# sudo mkfs.ext4 /dev/nvme1n1p5
- Check the network connection
- LAN: It usually works!
- WiFi: (Note: may have to use `iwctl`)
# wifi-menu
# ping www.google.com
- Select an appropriate mirror (for speeding things up)
# pacman -Syy
# pacman -S reflector
# cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
# reflector -c “US” -f 12 -l 10 -n 12 --save /etc/pacman.d/mirrorlist
- Install Arch linux
- Check thee drive again
- Mount the partition
- Install necessary packages using
pacstrap
# fdisk -l
# mount /dev/nvme1n1p5 /mnt
# pacstrap /mnt base linux linux-firmware vim
- Configure the arch linux
- Generate fstab file for how disk partitions
- Enter the mounted disk as root
- Setting timezone
- Setting up Locale
- Network configuration (hostname/hosts)
- Setting up root password
- Create a user (UID < 1000 shouldn’t be exposed to public)
# genfstab -U /mnt >> /mnt/etc/fstab
# arch-chroot /mnt
# timedatectl list-timezones
# timedatectl set-timezone US/Pacific
# locale-gen
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8
# echo arch > /etc/hostname
# touch /etc/hosts
Make sure that
/etc/hosts
have127.0.0.1 localhost
::1 localhost
127.0.1.1 arch
# passwd
# useradd tjenrung
# passwd tjenrung
Note: This is for modifying UID/GID.
# id tjenrung
# usermod -u 1001 tjenrung
# groupmoud -g 1001 tjenrung
# id tjenrung
- Install Grub bootloader
# pacman -S grub efibootmgr
# mkdir /boot/efi
# mount /dev/nvme1n1p2 /boot/efi
# grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
# grub-mkconfig -o /boot/grub/grub.cfg
- Install network manager + enable network manager
# pacman -S plasma-nm
# systemctl enable/disable NetworkManager
- At this point, you can probably boot to the drive (no more usb required).
- Install
sudo
# pacman -S sudo
Add <username> to
/etc/sudoers
with <username> ALL=(ALL) ALL
in the user privilege spec- Install desktop environment
# pacman -S xorg
# pacman -S plasma-desktop
# pacman -S xorg-xinit
# echo "exec startkde" > ~.xinitrc
- Install display manager
# pacman -S sddm kscreen
# systemctl enable/disable sddm
- Install audio (PulseAudio)
# pacman -S plasma-pa
- Install file manager
# pacman -S dolphin
- Install terminal
# pacman -S konsole
- Install AUR helper
yay
# pacman -S git base-devel
# cd opt
# sudo git clone https://aur.archlinux.org/yay-git.git
# sudo chown -R <user>:<group> ./yay-git
# cd yay-git
# makepkg -si
Note:
yay install: yay -S <program>
yay remove: yay -Rns <program>
yay update: yay -Syu
yay cleanup unwanted dependencies: yay -Yc
- [Optional] Install Firefox nightly
# yay -S firefox-nightly
If failed, clean
~/.cache/yay/firefox-nightly
# gpg --recv-keys <key>
- [Optional] Install Visual Studio Code Insiders
# yay -S visual-studio-code-insiders-bin
- Install nvidia driver
# pacman -S nvidia nvidia-utils nvidia-settings
Reboot and make sure that
nvidia-smi
works.- Install OpenSSH. This allows others to ssh to this server.
- Adding
AllowUsers <username>
- Turn on password auth
PasswordAuthentication yes
- Copy ssh-key by using
ssh-copy-id <user>@<ip>
- Turn off password auth
PasswordAuthentication no
# pacman -S openssh
# systemctl enable/disable sshd
Config the server at
/etc/ssh/sshd_config
.Recommendations:
- Install
wget
curl
andrsync
# pacman -S wget curl rsync
- Install
zsh
# echo $SHELL
# pacman -S zsh zsh-completions
This will invoke the first-time settings.
# zsh
Change the shell to
/bin/zsh
# chsh
# rm ~/.bashrc ~/.bash_history
- [Recommended] Install oh-my-zsh + plugins
# sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"
# rm ~/.zshrc.pre-oh-my-zsh
Restart the prompt. Install autosuggestions
# echo $ZSH_CUSTOM
# git clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting
# git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions
Set
plugins=(git brew zsh-syntax-highlighting zsh-autosuggestions)
- Install
node
npm
# pacman -S nodejs npm
- Install pure terminal theme (https://github.com/sindresorhus/pure)
# sudo npm install --global pure-prompt
Set
ZSH_THEME=""
in ~/.zshrc
Add this to
~/.zshrc
# Pure prompt
autoload -U promptinit; promptinit
prompt pure
- Install
htop
# pacman -S htop
- Install
tmux
# pacman -S tmux
- Install Miniconda3
# wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh
# chmod +x Miniconda3-latest-Linux-x86_64.sh
# ./Miniconda3-latest-Linux-x86_64.sh
# ~/miniconda3/bin/conda init zsh
- [Optional] Install F5VPN
# yay -S f5vpn
- Setup for an auto mount drive on start
- Find the UUID of the drive by running
fdisk -l
- Edit the file
/etc/fstab
accordingly (Note options=defaults, dump=0, pass=0)
- Setup for an auto Login
Add the following to
/etc/sddm.conf.d/autologin.conf
[Autologin]
User=<username>
Session=plasma
- Set GRUB for dual boot
- Install windows first, linux after
- Install linux first, windows after
Find the EFI partition using
# sudo fdisk -l
Find the UUID of windows using
# sudo blkid /dev/<partition>
Set the content to
menuentry "Windows 10" --class windows --class os {
insmod ntfs
search --no-floppy --set=root --fs-uuid <WINDOWS-UUID>
chainloader (${root})/EFI/Microsoft/Boot/bootmgfw.efi
}
Update GRUB
# grub-mkconfig -o /boot/grub/grub.cfg
Usually the steps would be create a partition from Linux. Then, you just install windows in that particular partition. If windows is not recognized by your bootloader, you may have to add it manually.
- Install OpenRGB for setting CPU Fan Color
# yay -S openrgb