Description of problem:
When installing and configuring CentOS, the system is configured with repositories that PackageKit is unable to refresh. This is because PackageKit does not necessarily load all repository variable definitions before fetching repository metadata.
I'm unsure of how pervasively problematic this would be for RHEL, but it's a huge problem for CentOS.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. pkcon refresh force
Fatal error: cannot update repo 'BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried; Last error: Status code: 404 for http://mirror.internode.on.net/pub/$contentdir/8/BaseOS/x86_64/os/repodata/repomd.xml
Refresh should be successful.
I've made a fix in upstream PackageKit for this some time ago: https://github.com/hughsie/PackageKit/commit/ed73aa6317595d2c2f1bda7990cbd64efb133f84
Note: I manually cloned this from the CentOS MantisBT (linked as an external bug) so that it can be properly tracked, and added information about the fix to make this easier to resolve.
I've submitted this as a pull request to CentOS Stream: https://git.centos.org/rpms/PackageKit/pull-request/1
Created attachment 1700492 [details]
Backport fix to make dnf vars load properly
I've attached Neal's pull request here in patch form. Because CentOS is still using the rpmbuild layout (SPECS and SOURCES directories), you'll need to use `patch -p2` to apply it to a flat tree (i.e. RHEL's dist-git).
"git am -p2" will also work using the commit straight from the PR. :)