3

I have installed things successful via yum on centos 7. Then I install epel repo (yum install epel-release ) and always give me followings error and after that I couldn't install anything

 One of the configured repositories failed (Unknown),
 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. Run the command with the repository temporarily disabled
        yum --disablerepo=<repoid> ...

 4. Disable the repository permanently, 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 <repoid>
    or
        subscription-manager repos --disable=<repoid>

 5. 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=<repoid>.skip_if_unavailable=true

I have searched a lot on the internet but I couldn't find solution. Some people maybe from proxy. even if I added my proxy information to yum.conf, but again I failed.

Then I want to check that If I delete epel repo then probably It may works and I deleted epel-repo from system after that I could install.

Please help me I spent this issues two days

  • can you post the error you got ? – Wissam Roujoulah Feb 15 '17 at 7:56
  • I have already posted this.....part of above One of the configured repositories failed (Unknown), 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: – Babak Mammadov Feb 15 '17 at 9:56
  • 1
    Do you still get the same error after running yum clean metadata? – jsbillings Feb 18 '17 at 4:54
  • I just uncommenting all baseurls in /etc/yum.repos.d/CentOS-Base.repo read more here: linuxquestions.org/questions/centos-111/… – Ammar Bozorgvar Apr 11 '18 at 22:36
4

As you have discovered, the package of epel-release is causing the issue. If you haven't already:

# yum remove epel-release

Then install the EPEL Repo with the following (requires wget package):

# wget http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-9.noarch.rpm
# rpm -ivh epel-release-7-9.noarch.rpm

From there you should be able to do yum update without any issues.

1

I just had this issue with fresh CentOS 7.6

Solution was simple:

  • Don't remove package epel-release (Install it if you have already removed it)
  • Edit the file /etc/yum.repos.d/epel.repo
  • In the first section ([epel]):
    • Comment metalink=https://...
    • Uncomment baseurl=http://...

This solved the issue for me.

0

Log in as root or use sudo and then:

#ONBOOT=no
#dhclient
#yum update

I hope it will fix this issue.

0

I too encountered this issue and root cause for this issue was yum repository was not accessible to the building docker image. So I have to change my network policy of my kubernetes cluster(since I was working on kubernetes project).

0

yum-config-manager --save --setopt=spacewalk-client.skip_if_unavailable=true

just run this above command and see BOOOOOOOOM

  • Code-only answers aren't that helpful by themselves. This answer would be much more useful if you explain how and why it solves the problem. See How to Answer. – Anthony Geoghegan May 8 at 9:31
0

Maybe you need to add your DNS servers to /etc/resolv.conf so it can know the hosts in the repo, for example in my case (google DNS is enough):

cat /etc/resolv.conf

# Generated by NetworkManager

nameserver 192.168.1.128 # local DNS

nameserver 8.8.8.8

nameserver 8.8.4.4

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.