2
votes

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.

2
Can you run curl 'https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64' manually and have that work?Etan Reisner
Yes, cuel is working on that link. But how to give it to yum ?Abhinav Kulshreshtha
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
not working for past few days.Abhinav Kulshreshtha
Shot in the dark but what does rpm -qa nss\* output?Etan Reisner

2 Answers

1
votes

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.

0
votes

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