不工作 yum update(yum 没有足够的缓存数据来继续)

Bab*_*dov 14 yum centos

我在centos 7上通过yum成功安装了东西。然后我安装了epel repo(yum install epel-release)并总是给我以下错误,之后我无法安装任何东西

 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
Run Code Online (Sandbox Code Playgroud)

我在互联网上搜索了很多,但找不到解决方案。有些人可能来自代理。即使我将我的代理信息添加到 yum.conf,但我还是失败了。

然后我想检查一下,如果我删除了 epel repo,那么它可能会起作用,然后我从系统中删除了 epel-repo,然后我就可以安装了。

请帮我我花了两天的时间

小智 11

正如您所发现的,epel-release 包导致了这个问题。如果您还没有:

# yum remove epel-release
Run Code Online (Sandbox Code Playgroud)

然后使用以下内容安装 EPEL Repo(需要 wget 包):

# 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
Run Code Online (Sandbox Code Playgroud)

从那里您应该可以毫无问题地进行 yum 更新。

  • 它给出了 404 错误 (2认同)

小智 9

我刚刚在新的 CentOS 7.6 上遇到了这个问题

解决方案很简单:

  • 不要删除包epel-release(如果您已经删除它,请安装它)
  • 编辑文件 /etc/yum.repos.d/epel.repo
  • 在第一节 ( [epel]) 中:
    • 评论 metalink=https://...
    • 取消注释 baseurl=http://...

这为我解决了这个问题。