【问题标题】:Error using YUM and DNF in Fedora 21在 Fedora 21 中使用 YUM 和 DNF 时出错
【发布时间】:2015-03-29 02:50:49
【问题描述】:

我阅读了this article in fedoramagzine.org 并遵循了这个过程。从那以后,我无法从 yum 和 dnf 执行更新、安装等。

这是我从 DNF 得到的错误

Abhinav@localhost ~$ sudo dnf 更新
[sudo] Abhinav 的密码:
错误:无法从 repo 'fedora' 同步缓存 'https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64': 无法准备内部镜像列表:卷曲错误:已达到超时 为了 https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64 [120002毫秒后连接超时]

这是我在使用 YUM 时遇到的错误

Abhinav@localhost ~$ sudo yum update 加载的插件:langpacks
配置的存储库之一失败(Fedora 21 - x86_64),并且 yum 没有足够的缓存数据来继续。此时 yum 能做的唯一安全的事情就是失败。有几种工作方式 “修复”这个:

 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

无法检索存储库的金属链接:fedora/21/x86_64。请 验证其路径并重试

我什至清空了/etc/yum.repos.d 中的所有存储库,除了您在安装发行版时获得的原始 3 个存储库。

更新 ::
@Etan Reisner这是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

更新 2

格式化我的笔记本电脑并重新安装 Fedora 21。在 3 sudo dnf updates 之后。我又被这个问题困住了。这次我没有按照上一篇文章中的步骤进行操作。

在进一步的谷歌搜索中,我发现https://fedorahosted.org/fedora-infrastructure/ticket/4517 谈到了同样的错误。它已关闭,但我再也找不到合适的解决方案。

【问题讨论】:

  • 你能手动运行curl 'https://mirrors.fedoraproject.org/metalink?repo=fedora-21&arch=x86_64' 并让它工作吗?
  • 是的,cuel 正在处理该链接。但是如何把它交给 yum 呢?
  • 这几乎肯定是 yum 已经在使用的链接。我从 dnf 错误输出中得到它。 dnf 和 yum 还是不行吗? (这不是暂时的网络错误吗?)
  • 过去几天没有工作。
  • 在黑暗中拍摄但rpm -qa nss\* 输出什么?

标签: fedora yum dnf


【解决方案1】:

如果您坐在代理后面,则必须相应地配置 dnf。 (即使用户的代理设置没有问题,您也必须为 dnf 设置它们。) dnf 设置存储在 /etc/dnf/dnf.conf 中。语法是:
proxy=://:

如果这不是您的问题,请尝试使用浏览器下载元数据,以确保您与 url 的网络连接正常。
要接收的文件应该是一个 xml 文件。如果您无法通过浏览器下载元数据,则可能是端口 443(用于 https)被阻止或您的 Internet 连接出现问题。

【讨论】:

  • 当时我不在代理服务器后面。我永远无法弄清楚问题背后的原因,但几个月后,dnf 推送了官方更新并解决了。我在 F22 上从来没有遇到过这个问题,现在正在等待 F23。我认为问题是由补丁引起的。
【解决方案2】:

问题

在使用 vagrant 启动 Fedora 23 VM master 时与 kubernete (k83) 有类似的错误

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

系统规范

操作系统

达尔文内核版本 15.6.0:2016 年 11 月 2 日星期三 20:30:56 PDT;根:xnu-3248.60.11.1.2~2/RELEASE_X86_64 x86_64

流浪

已安装版本:1.9.2 最新版本:1.9.2

Fedora

Fedora23 x86_64

RCA

  1. 登录 fedora23VM 时,以详细模式运行 yum update
    sudo yum --verbose update 从 metalink 中显示的每个存储库下载时出现 curl 超时。 例如

    错误:Curl 错误 (56):从 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.尝试了没有ssl证书验证的curl下载,它工作 即

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

解决方案

在 yum 更新期间禁用 ssl 证书验证,即

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-06-05
    • 1970-01-01
    • 1970-01-01
    • 2015-04-10
    • 2016-02-08
    • 2021-01-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多