But to be honest, I really want a better method to select the same packages on the new Fedora 19 system (B): I just want to install the packages from system A that were explicitly mentioned on a yum install command line - and not those that were installed as dependencies!

Why? Because perhaps dependencies have changed - and I don't want to install outdated dependencies on the new system. Plus, when I remove packages I want to remove the (possibly) then unneeded automatically installed dependencies (i.e. orphans) as well.

I've found yum list installed - but it does not display if a package was explicitly selected or just installed because of a dependency.

I'm not sure if this approach will get everything, I noticed these on my system when I ran repoquery ...: "Invalid yumdb querytag 'reason' for installed pkg: HandBrake-cli-0.9.5-1.fc14.x86_64"
–
slm♦Jul 13 '13 at 15:41

@slm, hm, from what repository was handbrake installed? Perhaps the repository setup has something to do with it?
–
maxschlepzigJul 13 '13 at 16:24

I think it might have been a standalone RPM that I installed using yum localinstall .... I had a fair amount of packages that fell into that camp though.
–
slm♦Jul 13 '13 at 16:35

I have an older version of Fedora (14) so my yum includes a less feature rich version of yum, but you might want to take a look at the yum history feature. I believe you can get the info you're looking for from that command.

Notice how yum reports whether a package was explicitly installed or installed because it was needed by a dependency. You could parse this info and get your list of packages that were explicitly installed.

I've added an answer based on your yum history idea, it also compares the results against the repoquery based method. As a side-effect I've extended my repoquery answer.
–
maxschlepzigJul 13 '13 at 19:20

Inspired by slm's answer I've come up with following yum history based solution:

Get all detailed history on all yum install transactions (i.e. no upgrades), excluding those execited as part of initial installer actions (transactions 1 and 2 on my system, attributed to user 'System'):

Why are there differences? Because repoquery includes all the packages from transactions 1 and 2, i.e. all packages which were installed by the Fedora installer. This explains why repoquery includes the mentioned packages xorg-x11-
drv-mga and friends.

Comparing repoquery-2nd and yum-history shows that repoquery-2nd is more accurate - it does not include some already removed packages. In addition it includes a few (2 on my system) packages from 'yum update'-operations, it seems.

Warning

The above history-based method only lists all explicitly installed packages over the complete lifetime of the system. It does not balance out those packages which were removed in a later transaction. Thus, this method needs some manual curating of the results and should only be used on systems were repoquery is not available.