Pacman

# change to fastest mirrors
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
sudo reflector --verbose --latest 10 --protocol https --sort rate --save /etc/pacman.d/mirrorlist

# open pacman config
sudo vim /etc/pacman.conf
# uncomment color
# uncomment paralled downloads
# add ILoveCandy
# pacman commands (reference)
sudo pacman -Syu # update everything
sudo pacman -S <package> # install a package
sudo pacman -Ss <search-term> # search from remote packages
sudo pacman -Q # list all install packages
sudo pacman -Qs <search-term> # search from installed packages
sudo pacman -Qe # list expecitly installed packages
sudo pacman -R <package> # remove package
sudo pacman -Rns <package> # remove package and extra config/depenencies

# for searching, replace s with i in the command to get more information

Pacman Wrappers

# paru and yay are pacman wrappers and AUR helpers
# only one needs to be installed, I prefer to use paru because of rust

# when downloading AUR packages, use <package>-bin for a precompiled version (faster), or use <packge> to build it yourself (configurable)

# --- install paru --- #
sudo pacman -S --needed rustup base-devel git && rustup default stable && git clone https://aur.archlinux.org/paru.git && cd paru && makepkg -si && cd .. && rm -rf paru

# open paru config
sudo vim /etc/paru.conf
# uncomment BottomUp

# --- install yay --- #
sudo pacman -S --needed git base-devel && git clone https://aur.archlinux.org/yay.git && cd yay && makepkg -si && cd .. && rm -R paru
# paru commands (refence)
# all pacman command work, just replace pacman with paru
paru # update everything
paru <package> # search and install
paru -Sua # update AUR packages only
paru -Qua # print available updates

Other Package Managers

Flatpak

# alternative app store. containerizes and resticts apps
sudo pacman -S flatpak

# additional protection tool
flathub flatpak install flathub com.github.tchx84.Flatseal
flatpak run com.github.tchx84.Flatseal

Build Package Manually

# manually build package (reference)
# https://www.youtube.com/watch?v=tCDy54Zc2Cw

# first time steps
vim /etc/makekpkg.conf
# uncomment MAKEFLATS line and set value to cpu threads + 1
# ex. 20 threads cpu: MAKEFLAGS='-j21'
mkdir -p ~/downloads/packages

# read PKGBUILD files before running makepkg
# check dependencies, conflicts, and commands at the bottom

# --- from source code --- #
# download
cd ~/downloads/packages
git clone https://aur.archlinux.org/paru.git

# build 
cd paru
makepkg -si

# update
cd ~/downloads/packages
cd paru
git pull
makepkg -si

# --- from tar.zst --- #
# download
cd ~/downloads/packages
wget https://github.com/Morganamilo/paru/releases/download/v2.0.4/paru-v2.0.4-x86_64.tar.zst

# build
sudo pacman -U paru-v2.0.4-x86_64.tar.zst