From 59fe07a6ab37120b4dd532e972c26deb7e7c7383 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Wed, 30 Apr 2025 08:24:15 -0700 Subject: [PATCH] solver: Call update_cache DNF apparently doesn't check the expiration time on the cache unless you call this first. It may help improve issues with the cache being out of sync. Internally dnf checks the mtime of the main repomd.xml file when using baseurl, and it checks the hash values when using metalink so this should not result in any noticeable extra slowdowns when things are fresh. --- osbuild/solver/dnf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/osbuild/solver/dnf.py b/osbuild/solver/dnf.py index 99217d5e..d7e5b94b 100755 --- a/osbuild/solver/dnf.py +++ b/osbuild/solver/dnf.py @@ -86,6 +86,7 @@ class DNF(SolverBase): repo_config.sslclientcert = modify_rootdir_path(repo_config.sslclientcert, root_dir) repo_config.sslclientkey = modify_rootdir_path(repo_config.sslclientkey, root_dir) + self.base.update_cache() self.base.fill_sack(load_system_repo=False) except dnf.exceptions.Error as e: raise RepoError(e) from e