DNF4 does not require manual `dnf clean X` step (9). Just `dnf makecache` is enough for the installer to realize there has been a change made in the repository. DNF5 however does not expire the metadata after second run of `createrepo` and therefore does not mandate its refresh. Reproducible: Always Steps to Reproduce: 1. mkdir /var/www/html/localrepo 2. place $package there 3. createrepo /var/www/html/localrepo 4. proper entry in /etc/yum.repos.d/localrepo 5. `dnf install $package` works => remove package.rpm from repo 6. createrepo /var/www/html/localrepo again 7. dnf makecache 8. `dnf install $package` tries to install $package from localrepo, then fails with Librepo error: Cannot download $package.rpm: All mirrors were tried 9. dnf clean all/metadata/expire-cache 10. dnf makecache (optional) 11. dnf install $package => works as intended (meaning regular error) Actual Results (at step 8): Updating and loading repositories: Repositories loaded. Package Arch Version Repository Size Installing: package x86_64 5.9-15.fc41 localrepo 7.9 MiB Transaction Summary: Installing: 1 package Total size of inbound packages is 3 MiB. Need to download 3 MiB. After this operation, 8 MiB extra will be used (install 8 MiB, remove 0 B). Is this ok [y/N]: y [1/1] package-0:5.9-15.fc41.x86_64 0% | 0.0 B/s | -1.0 B | ? >>> Curl error (37): Could not read a file:// file for file:///var/www/html/localrepo/package-5.9-15.fc41.x86_64.rpm [Couldn't open file /var/www/ >>> No more mirrors to try - All mirrors were already tried without success ---------------------------------------------------------------------------------------------------------------------------------------------- [1/1] Total ???% | 0.0 B/s | -1.0 B | 00m00sFailed to download packages Librepo error: Cannot download package-5.9-15.fc41.x86_64.rpm: All mirrors were tried Expected Results: Last metadata expiration check: 0:00:02 ago on Wed 06 Nov 2024 08:58:13 AM EST. No match for argument: package Error: Unable to find a match: package I am not sure whether this is a bug or intended behavior, however this is a difference between dnf4 and dnf5. With dnf4 step 8 would already give the proper error (Unable to find a match)
`dnf5 makecache` does not update valid (non-expired) caches. Updates of non-expired caches can be forced using the `--refresh` argument -> `dnf5 --refresh makecache`. It's an improvement. In dnf5 we can create/update invalid caches without modifying non-expired ones. If we want to update even non-expired ones, we add `--refresh`. `--refresh` is universal and can be added to other commands as well. For example, `dnf --refresh download package`. We call the `dnf makecache` command when we only want to update caches and nothing more. For example, regularly in cron so that the user has valid caches. The new `makecache` behaviour is more flexible. However, it is a change from dnf4. So we need to either document the change or, as part of compatibility with the old version, change the behavior of dnf5 so that the `makecache` command also updates unexpired caches - as if the `--refresh` argument were present.
Update: In the DNF4 documentation it is mentioned about `makecache`: Downloads and caches metadata for enabled repositories. Tries to avoid downloading whenever possible (e.g. when the local metadata hasn't expired yet or when the metadata timestamp hasn't changed). So DNF5 behaviour is not new. It is compatible with the DNF4 documentation. The bug is in DNF4, which behaves differently from the documentation.
I created https://github.com/rpm-software-management/dnf/issues/2242 to document the flaw in DNF4 and https://github.com/rpm-software-management/dnf5/pull/2257 to update the changes_from_dnf4 document.
FEDORA-2025-a5e5885906 (dnf5-5.2.15.0-1.fc42 and librepo-1.20.0-1.fc42) has been submitted as an update to Fedora 42. https://bodhi.fedoraproject.org/updates/FEDORA-2025-a5e5885906
FEDORA-2025-fb095dd283 (dnf5-5.2.15.0-1.fc41 and librepo-1.20.0-1.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2025-fb095dd283
FEDORA-2025-a5e5885906 has been pushed to the Fedora 42 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-a5e5885906` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-a5e5885906 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2025-fb095dd283 has been pushed to the Fedora 41 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-fb095dd283` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-fb095dd283 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2025-9ae670b810 (dnf5-5.2.15.0-2.fc42 and librepo-1.20.0-1.fc42) has been submitted as an update to Fedora 42. https://bodhi.fedoraproject.org/updates/FEDORA-2025-9ae670b810
FEDORA-2025-fdcda3af30 (dnf5-5.2.15.0-2.fc41 and librepo-1.20.0-1.fc41) has been submitted as an update to Fedora 41. https://bodhi.fedoraproject.org/updates/FEDORA-2025-fdcda3af30
FEDORA-2025-9ae670b810 has been pushed to the Fedora 42 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-9ae670b810` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-9ae670b810 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2025-fdcda3af30 has been pushed to the Fedora 41 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2025-fdcda3af30` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2025-fdcda3af30 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2025-9ae670b810 (dnf5-5.2.15.0-2.fc42 and librepo-1.20.0-1.fc42) has been pushed to the Fedora 42 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2025-fdcda3af30 (dnf5-5.2.15.0-2.fc41 and librepo-1.20.0-1.fc41) has been pushed to the Fedora 41 stable repository. If problem still persists, please make note of it in this bug report.