CURL Error during DNF update

So I got this annoying CURL error during DNF update.

- Curl error (37): Couldn't read a file:// file for file:///home/heinrich/repodata/repomd.xml [Couldn't open file /home/heinrich/repodata/repomd.xml]
Error: Failed to download metadata for repo 'home_heinrich_': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried

Concerned, I carefully read this post:

I did a sudo dnf clean all and then tried dnf update again, and got the same result.

[heinrich@p1-fedora ~]$ sudo dnf clean all
156 files removed
[heinrich@p1-fedora ~]$ sudo dnf update
created by dnf config-manager from https://brave-browser-rpm-release.s3.brave. 4.5 kB/s | 8.8 kB     00:01    
Docker CE Stable - x86_64                                                      4.3 kB/s | 5.9 kB     00:01    
Fedora 34 - x86_64                                                             5.9 MB/s |  74 MB     00:12    
Fedora 34 openh264 (From Cisco) - x86_64                                       929  B/s | 2.5 kB     00:02    
Fedora Modular 34 - x86_64                                                     1.2 MB/s | 4.9 MB     00:03    
Fedora 34 - x86_64 - Updates                                                   2.5 MB/s |  14 MB     00:05    
Fedora Modular 34 - x86_64 - Updates                                           1.1 MB/s | 4.2 MB     00:03    
google-chrome                                                                  3.0 kB/s | 3.6 kB     00:01    
created by dnf config-manager from file:///home/heinrich/                      0.0  B/s |   0  B     00:00    
Errors during downloading metadata for repository 'home_heinrich_':
  - Curl error (37): Couldn't read a file:// file for file:///home/heinrich/repodata/repomd.xml [Couldn't open file /home/heinrich/repodata/repomd.xml]
Error: Failed to download metadata for repo 'home_heinrich_': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
MySQL 8.0 Community Server                                                     235 kB/s | 418 kB     00:01    
MySQL Connectors Community                                                      17 kB/s |  17 kB     00:01    
MySQL Tools Community                                                           66 kB/s |  86 kB     00:01    
ProtonVPN Fedora 33 repository                                                 8.0 kB/s |  24 kB     00:03    
RPM Fusion for Fedora 34 - Free                                                317 kB/s | 941 kB     00:02    
RPM Fusion for Fedora 34 - Free - Updates                                      102 kB/s | 174 kB     00:01    
RPM Fusion for Fedora 34 - Nonfree                                             133 kB/s | 246 kB     00:01    
RPM Fusion for Fedora 34 - Nonfree - Updates                                    11 kB/s |  17 kB     00:01    
skype (stable)                                                                 2.0 kB/s | 4.3 kB     00:02    
slack                                                                          9.2 kB/s |  46 kB     00:04    
Sublime Text - x86_64 - Stable                                                 1.2 kB/s | 2.1 kB     00:01    
vivaldi-snapshot                                                                10 kB/s |  11 kB     00:01    
Ignoring repositories: home_heinrich_
Dependencies resolved.
Nothing to do.
Complete!
[heinrich@p1-fedora ~]$

Why DNF looking for a local file as a repo?

I can still update, but this error is annoying. Do I need to rebuild my DNF db?

That must be a local repository that you or some tool with root permission set up for you. (createrepo_c can be used for that, for example).

Have a look at /etc/yum.repos.d/ - you likely have a file called home_heinrich_.repo there

cat /etc/yum.repos.d/home_heinrich_.repo

You can set it to enabled=0 to get rid of the dnf error message and then find out what that repo is and where it’s coming from.
(sudo dnf config-manager --set-disabled home_heinrich_

2 Likes
cat /etc/yum.repos.d/home_heinrich_.repo
[home_heinrich_]
name=created by dnf config-manager from file:///home/heinrich/ 
baseurl=file:///home/heinrich/ 
enabled=1

Obviously I must have fat-fingered something and accidentally created this local repo.

I set it to disabled.

No more goofy error.

sudo dnf update
Last metadata expiration check: 3:11:16 ago on Wed 09 Jun 2021 09:57:42 AM +05.
Dependencies resolved.
Nothing to do.
Complete!
[heinrich@p1-fedora ~]$
1 Like