This is more a question about dnf than anything else, but I haven’t been able to figure out if this is possible (and maybe it isn’t). Here’s the scenario:
If you want a particular package that was updated in Cooker installed, you can install it as a one-off without adding the Cooker repo permanently (which would be bad). If, for example, you want a newer version of Syncthing, you can install it like this:
However, eventually Rome will get the updates from Cooker and you then won’t want to exclude the package. But Cooker might then get an even more up to date version, and then you’ll want to install that version again.
My question is, is there a way to make the idea “I want the Cooker version of this package, and this package alone” sticky? In other words, I want Rome for the stability, but certain packages should always come from Cooker. And when I distro-sync, it should check certain packages against the Cooker repo for updates (because I’ve specified it) instead of the Rome version.
As I said, this may not be possible; I haven’t been able to find anything about dnf that allows this. But I figured I’d ask, because there are people here much more experienced with it than I am.
This could actually be very helpful. Sorry that I can’t provide an answer…I’m just commenting to express my interest in something like this maybe being possible
You may be able to do something with dnf’s repository-packages command, the 4th last example in its documentation page sounds near to what you want to achieve:
Select all packages installed from the repository. Upgrade, downgrade or keep those of them that are available in another repository to match the latest version available there and remove the others along with any packages depending on the packages being removed. If clean_requirements_on_remove is enabled (the default) also removes any dependencies that are no longer needed.
By using the --exclude= parameter that you already mentioned and following up with the dnf repository-packages command you may be able to chain or script them together to get to where you want to be with that.
As it may involve potentially ruinous usage of dnf, I would recommend spinning up a VM and trying out what you are wanting to do inside those safer confines to preserve your system as-is until you get what you are wanting to do figured out.
Edit to add:
There is a potential issue with the repository-packages command going forward though, I cannot seem to find it in DNF5’s documentation, so it may just be a temporary resolution, but dnf5 does have a versionlock that may also fit your needs - https://dnf5.readthedocs.io/en/latest/commands/versionlock.8.html
Thank you all. So far, I’ve been unsuccessful. Using Syncthing as the example (since 1.29.2 is in Rome and 1.29.7 is in Cooker), I went ahead (in a VM) and installed the Cooker version of Syncthing like this: