Ok
first of all, this is good article for anyone interested in generating package list
https://linuxhint.com/list_installed_packages_pacman_arch_linux/
In this example i’m using -Qqe option, but you can manually edit this list or make your own with only desired packages
Generating package list
pacman -Qqe >installed_packages.txt
Edit the list as you want using your prefered text editor
For AUR packages.
OBS: this actually list any package external from official, so endeavouros packages are also listed here.
pacman -Qqm >aur_packages.txt
#installing
There are multiples ways to accomplish this, i’ll give a couple examples
if you have one package by line you can:
1)
sudo pacman -S $(cat installed_packages.txt |xargs) --needed --noconfirm
Or even
2)
for x in $(cat installed_packages.txt); do sudo pacman -S $x --needed --noconfirm; done
3 )For AUR
yay -S $(cat aur_packages.txt |xargs) --needed --noconfirm
- -needed will only install new packages, so you won’t waste time reinstalling the already installed
- -noconfirm won’t prompt the confirmation step “Do you want to install?”. Recommended specially for the second method and with huge list of files