One thing Linux offers over Windows is the ability to maintain software via packages. A way I love making use of this in openSUSE is by periodically exporting a list containing my installed packages, which is possible via YaST - Software Management in xml format. The advantage is that whenever I do a fresh install, I don’t need to remember and manually reinstall any software: I simply import the xml and every non-default package I had installed will be added back as if nothing happened. There has to be a way to do something similar with pacman! At least I’m hoping there is, this is an ability I care to have.
I’d like to know if there are any commands to export all installed packages to a list (txt, xml, json, etc) then import this list so that all packages on it which aren’t already installed will be. Ideally in a version agnostic format, so if the package was updated in the repositories since our list was generated the system still knows what it’s looking for.