I suppose I could give the third-party repository a higher
priority number for lower precedence, though
cost seems redundant as it looks like it’s for breaking ties in
priority. However that doesn’t deal at the package level.
From reading the docs linked,
includepkgs is probably what I’m looking for, at least for my first question:
Include packages of this repository, specified by a name or a glob and separated by a comma, in all operations. Inverse of excludepkgs, DNF will exclude any package in the repository that doesn’t match this list.
That doesn’t “pin” a package to prioritize a specific repository, though perhaps combining
includepkgs with a low priority number (high preference) on the repository might achieve this.
Also, the docs mention this affects DNF’s decisions, but do not mention the effect on other software upgrade mechanisms like
dnfdragora, so it’s probably necessary to keep in mind that these options may not be respected universally.