Ask Your Question
4

Error: Failed to synchronize cache for repo 'fedora'

asked 2016-05-23 01:25:56 -0600

Es02 gravatar image

updated 2017-01-13 15:48:01 -0600

mattdm gravatar image

Fresh install of FC24 from USB, any time I attempt to install anything through DNF I get the following:

# dnf install nano
Repository InstallMedia has no mirror or baseurl set.
Error: Failed to synchronize cache for repo 'fedora'

Theres nothing wierd in my dnf config:

# cat /etc/dnf/dnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=True

The .repo file in /etc/yum.repos.d/fedora.repo looks fine to me so I'm not sure where to go from here.

edit retag flag offensive close merge delete

Comments

1

Usually this means that either your internet connection is not working or the mirror you are trying to reach is down (or has problems).

Please post /etc/yum.repos.d/fedora.repo, and /etc/yum.repos.d/fedora-updates.repo in your question above (I know, you said it's fine, let's just double-check).

Did you already try sudo dnf clean all && sudo dnf upgrade?

florian gravatar imageflorian ( 2016-05-23 11:47:18 -0600 )edit

Yes I've done a clean all and an upgrade - I get the same error every time I try to do anything with dnf unless I disable the repo.

Contents of the .repo file is : http://pastebin.com/G6Lqz9wX

Es02 gravatar imageEs02 ( 2016-05-23 18:28:13 -0600 )edit

Please see my answer below. You need to change line 5 of your fedora.repo from

baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/

to

baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/test/24_Beta/Everything/$basearch/os/

This is a weird bug, and not all Beta users are experiencing this. Please consider reporting the bug on bugzilla.redhat.com .

Also change that line back as soon as Fedora 24 is released.

florian gravatar imageflorian ( 2016-05-25 10:42:20 -0600 )edit

You may have to do the same for fedora-updates-testing.repo

florian gravatar imageflorian ( 2016-05-25 10:46:11 -0600 )edit

12 Answers

Sort by » oldest newest most voted
2

answered 2016-05-24 09:07:18 -0600

florian gravatar image

updated 2016-05-25 10:42:51 -0600

Problem could be that the server does currently doesn't provide the repository as configured:

If you go here http://download.fedoraproject.org/pub... , you will see that there is only a folder test (for F24_Alpha & F24_beta), but no folder 24

If $releasever in your fedora.repo points to 24 (instead of test/24_Beta), dnf will just not find the repo and its metadata.

As a quick workaround, you can comment (#) the existing baseurl line an add the following (in fedora.repo and fedora-updates.repo):

baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/test/24_Beta/Everything/$basearch/os/
edit flag offensive delete link more

Comments

Folks, note that this answer is totally outdated...

florian gravatar imageflorian ( 2016-11-28 08:39:53 -0600 )edit

The identical error message can still happen. It happened to me a few days ago, on Fedora 24 and then 25.

In my case, the solution was to manually download and locally reinstall ca-certificates. I had corrupted the certifcate chain. I used RPM to do the actual re-installation

rpm --reinstall ./ca-certificates-2016.2.7-1.0.fc24.noarch.rpm
amusette gravatar imageamusette ( 2016-12-15 11:37:04 -0600 )edit

Same problem for me today on Fedora 25. Solved thanks to this answer. Just changed metalink to baseurl.

vain gravatar imagevain ( 2017-08-12 13:15:47 -0600 )edit

Same problem for me, using Fedora 26. Just changed metalink to baseurl.

wind39 gravatar imagewind39 ( 2017-12-27 08:22:49 -0600 )edit
2

answered 2016-07-19 16:51:05 -0600

caio.souza gravatar image

dnf may have problems if you are using some proxy configurations.

So if you are using, edit the file /etc/dnf/dnf.conf. Add the follow lines: proxy=http://192.168.0.1:8080 proxy_username=proxy.user proxy_password=myproxypassword

If you are using a specific proxy, just add the follow line with you proxy adress and port: proxy=http://{adress}:{port}

After this try to run some dnf install/search command. For example: dnf install nano

edit flag offensive delete link more

Comments

This solved my problem. Thanks.

aman_singh gravatar imageaman_singh ( 2016-07-28 00:52:06 -0600 )edit

It worked for me. Thanks :)

Om Prakash gravatar imageOm Prakash ( 2016-10-17 02:36:19 -0600 )edit

I'v changed my system proxy and it resolved, thanks

zebardast gravatar imagezebardast ( 2016-12-20 00:49:59 -0600 )edit

Thank You It worked.

chaitanya5398 gravatar imagechaitanya5398 ( 2017-02-25 07:22:51 -0600 )edit
1

answered 2017-05-10 13:53:41 -0600

Please check if update URL's are resolving properly and DNS is working. I had this issue due to DNS. We need better Error Reporting from DNF.

edit flag offensive delete link more
1

answered 2017-08-30 19:28:38 -0600

acortes gravatar image

Yes, it can be DNS issue. Try checking /etc/resolv.conf and see if nameserver is set to something like 8.8.8.8.

edit flag offensive delete link more
1

answered 2018-11-21 05:45:44 -0600

adioe3 gravatar image

I ran into this problem as well and it turns out /tmp was full. You can check with du -hs if it's chock full and if so, lose some things.

edit flag offensive delete link more
0

answered 2017-05-10 13:50:49 -0600

I have seen this issue happening in Fedora 25 as well, when DNS fails to resolve the update URL's. Maybe we need better Error Reporting from DNF.

edit flag offensive delete link more
0

answered 2018-08-15 23:37:22 -0600

I had this problem because I set firewall.d to accept HTTPS but not HTTP. I added HTTP and it resolved the issue.

edit flag offensive delete link more
0

answered 2017-09-09 21:54:24 -0600

I have nscd running. It was my problem. By doing a "ps -aux | grep nscd" and locating the process ID, perform a "kill" on that process ID number cleared up the issue. The nscd daemon restarts and behaves.

I'm guessing that nscd does not wait for the network service to fully start before it starts before caching host name to IP address entries.

edit flag offensive delete link more
0

answered 2016-11-28 06:53:12 -0600

There is something wrong with the trusted ciphers. FC24-25 defaults to FUTURE set of ciphers in /etc/crypto-policies/config. Changing that to default and running update-crypto-policies fixed this for me. Something is probably off in the FUTURE backends/gnutls.config.

With FUTURE even wget gets an error on the cert:

wget -p -O /dev/null "https://mirrors.fedoraproject.org/metalink?repo=updates-released-f25&arch=x86_64"
WARNING: combining -O with -r or -p will mean that all downloaded content
will be placed in the single file you specified.

--2016-11-28 13:51:25--  https://mirrors.fedoraproject.org/metalink?repo=updates-released-f25&arch=x86_64
Resolving mirrors.fedoraproject.org (mirrors.fedoraproject.org)... 209.132.181.15, 66.35.62.162, 140.211.169.196, ...
Connecting to mirrors.fedoraproject.org (mirrors.fedoraproject.org)|209.132.181.15|:443... connected.
ERROR: The certificate of ‘mirrors.fedoraproject.org’ is not trusted.
ERROR: The certificate of ‘mirrors.fedoraproject.org’ was signed using an insecure algorithm.
edit flag offensive delete link more

Comments

I would discuss this as a separate question. Has not much to do with the original post...

florian gravatar imageflorian ( 2016-11-28 08:41:33 -0600 )edit
0

answered 2016-05-25 03:22:36 -0600

As per florian above, the repo isn't configured correctly due to the 'test' folder in front of the 'releases' folder. I have a vm running F24_beta and rectified the issue by modifying the baseurl as follows:

baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/test/24_beta/Everything/$basearch/os/

This allowed me to update the repo successfully. I was then prompted about updates and updates-testing and had to uncomment the baseurl for those as well (remove the '#' at the start of the line) but that may have been something peculiar to how my VM connects to the internet rather than an actual problem with those repos.

edit flag offensive delete link more

Comments

Not sure, I completely understand the above - is updates-testing working? If yes, all fine. If not, do the same as you did for fedora.repo

florian gravatar imageflorian ( 2016-05-25 09:49:23 -0600 )edit

I was testing behind a corporate firewall/proxy, so not sure if there was some quirk with that, but I found that when I ran echo $releasever it didn't have anything set for the variable, might have been a temporary bug, but I ended up replacing $releasever with 24 for updates and updates-testing in the baseurl and then it worked, but note that updates and updates-testing do not use the /test/ subfolder in the baseurl. side note: I lodged this with bugzilla as Bug#: 1339860

t3rm1n4l gravatar imaget3rm1n4l ( 2016-05-25 20:09:28 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2016-05-23 01:25:56 -0600

Seen: 122,989 times

Last updated: Oct 03 '16