Description of problem:
Versionlock in yum used to allow us to upgrade a previous version of the package. For example, if we had puppet agent 6.4.2 installed, and versionlocked at 6.4.2, we could then update the versionlock to 6.5.0 and then yum upgrade puppet-agent and that would work. dnf, on the other hand, appears to lose all knowledge that there is or ever was puppet-agent 6.4.2. Basically it claims there is nothing to upgrade. It would let me install puppet agent 6.5.0, but it treats it like there is nothing to upgrade and just layers things on top. Strangely, I can work around this by manually adding BOTH 6.4.2 and 6.5.0 locks to versionlock.list, but that's not particularly sustainable.
Please note that I use the puppet yum module to handle versionlocks, which adds entries to versionlock.list rather than using the dnf commands. However, I believe that is considered a perfectly legit means of maintaining that file.
Version-Release number of selected component (if applicable):
I can easily reproduce with the steps below
Steps to Reproduce:
1. add to /etc/dnf/plugins/versionlock.list: puppet-agent-0:6.4.2-1.el8.x86_64
2. install puppet-agent 6.4.2
3. replace the line from step 1 with: puppet-agent-0:6.5.0-1.el8.x86_64
4. dnf upgrade puppet-agent-6.5.0
Package puppet-agent available, but not installed.
No match for argument: puppet-agent-6.5.0
Error: No packages marked for upgrade.
--> Running transaction check
---> Package puppet-agent.x86_64 0:6.4.2-1.el7 will be updated
---> Package puppet-agent.x86_64 0:6.5.0-1.el7 will be an update
--> Finished Dependency Resolution
Package Arch Version Repository Size
puppet-agent x86_64 6.5.0-1.el7 puppet6 22 M
Upgrade 1 Package
Total download size: 22 M
Is this ok [y/d/N]:
I don't know that this isn't intended behavior, but it worked very cleanly with yum in RHEL 7 and make for some easy ways to handle puppet-led upgrades. And of course -- if you go to reproduce the expected behavior on RHEL7, make sure to replace el8 with el7 in your lock. =)
I don't think this behaviour is intended.
PR https://github.com/rpm-software-management/dnf-plugins-core/pull/364 fixes it and enables upgrading installed package to the locked version.
Encountered the same issue.
I can confirm that https://github.com/rpm-software-management/dnf-plugins-core/pull/364 indeed fixes this issue (I applied the patch manually).
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.