Create a list of all currently installed packages

Native (manually installed via pacman)

sudo pacman -Qn > native.list

Foreign (typically installed through an AUR package manager)

sudo pacman -Qm > foreign.list

Combine and sort the list

cat native.list foreign.list > total.list
sort total.list | uniq > install.list && rm ./{native.list,foreign.list,total.list}


Use an AUR package manager to install ALL packages from both mainline and AUR.
(if you come across any errors about package conflicts, etc. - simply remove the package from install.list)

yay -S --needed --noconfirm $(grep -E "^[a-z]" ./install.list)