How to fix "systemd[1]: dnf-makecache.service: Failed with result 'exit-code'."
Issue
- The
/var/log/messageslog shows error messages as below:
[warning] systemd[1]: dnf-makecache.service: Failed with result 'exit-code'.
[err] systemd[1]: Failed to start dnf makecache.
- The
yumcommand or/var/log/dnf.logshows the following error: "Curl error (37): Couldn't read a file:// file for file:///mnt/BaseOS/repodata/repomd.xml [Couldn't open file /mnt/BaseOS/repodata/repomd.xml]"
Environment
- Red Hat Enterprise Linux 8 and later
- systemd
- dnf-makecache.service
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.