Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Failed to synchronize cache for repo 'updates' [closed]

I am using Fedora 25. I'm trying to install gcc on fedora25 using the sudo dnf install gcc command. It is always showing:

Error: Failed to synchronize cache for repo 'updates'

I am also getting the same error when I try to install other packages. What am I doing wrong?

like image 407
Naveen Kumar Avatar asked Jul 26 '17 05:07

Naveen Kumar


1 Answers

I just ran into this as well. Adding the verbose flag showed the $releasever wasn't set in the url. Check this yourself with dnf update -v

Look for these lines in the output:

Cannot download 'https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=x86_64': Cannot prepare internal mirrorlist: file "repomd.xml" was not found in metalink. 
Error: Failed to synchronize cache for repo 'fedora'

I fixed the issue with dnf clean all && dnf update --releasever=25. This overrides the $releasever with the one you supply. After that, I was able to update and install rpms again.

like image 152
jcope Avatar answered Sep 29 '22 04:09

jcope