3

I read this article in fedoramagzine.org and followed the process. Since then I am unable to perform updates, installation etc from both yum and dnf.

This is the error I get from DNF

Abhinav@localhost ~$ sudo dnf update
[sudo] password for Abhinav:
Error: Failed to synchronize cache for repo 'fedora' from 'https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64': Cannot prepare internal mirrorlist: Curl error: Timeout was reached for https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64 [Connection timed out after 120002 milliseconds]

and this is the error I get when using YUM

Abhinav@localhost ~$ sudo yum update Loaded plugins: langpacks
One of the configured repositories failed (Fedora 21 - x86_64), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this:

 1. Contact the upstream for the repository and get them to fix the problem.

 2. Reconfigure the baseurl/etc. for the repository, to point to a working
    upstream. This is most often useful if you are using a newer
    distribution release than is supported by the repository (and the
    packages for the previous distribution release still work).

 3. Disable the repository, so yum won't use it by default. Yum will then
    just ignore the repository until you permanently enable it again or use
    --enablerepo for temporary usage:

        yum-config-manager --disable fedora

 4. Configure the failing repository to be skipped, if it is unavailable.
    Note that yum will try to contact the repo. when it runs most commands,
    so will have to try and fail each time (and thus. yum will be be much
    slower). If it is a very temporary problem though, this is often a nice
    compromise:

        yum-config-manager --save --setopt=fedora.skip_if_unavailable=true

Cannot retrieve metalink for repository: fedora/21/x86_64. Please verify its path and try again

I even emptied all the repos in /etc/yum.repos.d except for the original 3 repos you get when you install distro.

UPDATE ::
@Etan Reisner Here is the output of rpm -qa nss\*

 Abhinav@localhost ~$ rpm -qa nss\*
 nss-softokn-freebl-3.17.3-1.fc21.x86_64
 nss-util-devel-3.17.3-1.fc21.x86_64 nss-sysinit-3.17.3-2.fc21.x86_64
 nss-util-3.17.3-1.fc21.x86_64 nss-tools-3.17.3-2.fc21.x86_64
 nss-softokn-freebl-3.17.3-1.fc21.i686 nss-3.17.3-2.fc21.x86_64
 nss-softokn-freebl-devel-3.17.3-1.fc21.x86_64
 nss-mdns-0.10-15.fc21.x86_64 nss-mdns-0.10-15.fc21.i686
 nss-util-3.17.3-1.fc21.i686 nss-softokn-3.17.3-1.fc21.i686
 nss-devel-3.17.3-2.fc21.x86_64 nss-softokn-devel-3.17.3-1.fc21.x86_64
 nss-3.17.3-2.fc21.i686 nss-softokn-3.17.3-1.fc21.x86_64

UPDATE 2

Formatted my laptop and re-installed Fedora 21. After 3 sudo dnf updates. I am stuck with this problem again. This time i didn't follow the steps on the previous article.

On further google search I found https://fedorahosted.org/fedora-infrastructure/ticket/4517 which talks about same error. It is closed but I can't find a proper solution again.

ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Abhinav Kulshreshtha
  • 2,147
  • 1
  • 23
  • 38
  • Can you run `curl 'https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64'` manually and have that work? – Etan Reisner Jan 29 '15 at 18:46
  • Yes, cuel is working on that link. But how to give it to yum ? – Abhinav Kulshreshtha Jan 30 '15 at 06:52
  • That's almost certainly the link yum is already using. I got it from the dnf error output. Are dnf and yum still not working? (This wasn't some transient network error?) – Etan Reisner Jan 30 '15 at 11:12
  • not working for past few days. – Abhinav Kulshreshtha Jan 30 '15 at 12:55
  • Shot in the dark but what does `rpm -qa nss\*` output? – Etan Reisner Jan 30 '15 at 14:22
  • @EtanReisner Please see the Update for the output. – Abhinav Kulshreshtha Jan 31 '15 at 16:32
  • Nothing in there stands out (which I was expecting). At this point, assuming this is still happening with the same errors, the only thing I can think to try is to get a packet capture of `dnf`/`yum` attemping to fetch the repository metadata and see if that tells us anything (also a capture of that `curl` command from my first comment). – Etan Reisner Feb 02 '15 at 13:54
  • How do I do that. please elaborate the process @EtanReisner – Abhinav Kulshreshtha Feb 02 '15 at 18:10
  • Run a packet capturing tool (`wireshark`/etc.) and run the three commands (`dnf`, `yum`, and `curl`) and then look at (or upload and link to so we can look at it) the capture to see what is happening when each tool attempts to connect to that URL (and to see whether they all are, in fact, using the same URL). – Etan Reisner Feb 03 '15 at 03:43

2 Answers2

1

If you sit behind a proxy, you have to configure dnf accordingly. (Even if the user's proxy settings are fine, you have to set them for dnf anyway.) The dnf settings are stored in /etc/dnf/dnf.conf. The syntax is:
proxy=<protocol>://<ip or name>:<port>

If this is not your problem, try to download the metadata with the browser to ensure, that your network connection to the url is working.
The file to receive should be an xml file. If you cannot download the metadata via the browser, chances are, that either port 443 (for https) is blocked or there is something wrong with your internet connection.

huck
  • 11
  • 2
  • I wasn't behind proxy at that time. I Could never figure out the cause for the issue behind it but in few months, dnf pushed an official update and It resolved. I never had this issue on F22 and now waiting for F23. I think the issue was caused because of the patch. – Abhinav Kulshreshtha Sep 30 '15 at 04:28
0

Issue

Had similar errors with kubernete (k83) while starting Fedora 23 VM master with vagrant

Error: Failed to synchronize cache for repo 'updates' from 

System Spec

OS

Darwin Kernel Version 15.6.0: Wed Nov 2 20:30:56 PDT 2016; root:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64

Vagrant

Installed Version: 1.9.2 Latest Version: 1.9.2

Fedora

Fedora23 x86_64

RCA

  1. While logged into fedora23VM , running yum update in verbose mode
    sudo yum --verbose update a curl timeout on downloading from each of the repository presented in the metalink. e.g

    error: Curl error (56): Failure when receiving data from the peer for http://ftp.polytechnic.edu.na/pub/fedora/linux/updates/23/x86_64/repodata/af3c46471b1d685f22c72a5e16d7383d333fb89db278711b2b8c794e29a91eaa-filelists.xml.gz [Recv failure: Connection reset by peer] (http://ftp.polytechnic.edu.na/pub/fedora/linux/updates/23/x86_64/repodata/af3c46471b1d685f22c72a5e16d7383d333fb89db278711b2b8c794e29a91eaa-filelists.xml.gz).

2.Tried curl download without the ssl certificate verification and it worked i.e

curl -k -O https://www.ftp.saix.net/linux/distributions/fedora/linux/updates/23/x86_64/repodata/repomd.xml

Solution

Disable ssl certificate verification during the yum update i.e

sudo yum --verbose update  --setopt "sslverify=0"  -y