【问题标题】:Errno 14 HTTPS Error 301 - Moved Permanently while installing Jenkins - yum install jenkinsErrno 14 HTTPS 错误 301 - 安装 Jenkins 时永久移动 - yum install jenkins
【发布时间】:2020-11-11 17:27:03
【问题描述】:

[root@###~]# yum install jenkins 加载的插件:fastestmirror、product-id、search-disabled-repos、subscription-manager

此系统未在授权服务器上注册。您可以使用订阅管理器进行注册。

从缓存的主机文件加载镜像速度

其中一个配置的存储库失败(Jenkins-stable), 并且 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. Run the command with the repository temporarily disabled
        yum --disablerepo=jenkins ...

 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 jenkins
    or
        subscription-manager repos --disable=jenkins

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

失败:来自 jenkins 的 repodata/repomd.xml:[Errno 256] 没有更多镜像可以尝试。 http://pkg.jenkins.io/redhat-stable/repodata/repomd.xml:[Errno 14] HTTPS 错误 301 - 永久移动

请帮帮我

【问题讨论】:

  • 同样的问题,但对于我所有的包裹......你找到解决方案了吗?

标签: jenkins continuous-integration devops failed-installation


【解决方案1】:

看起来 jenkins.io 当前分发的jenkins.repo 文件配置为使用http,而不是https。 (来吧,人们,认真的吗?这是 2021 年。)幸运的是,您可以轻松编辑 /etc/yum.repos.d/jenkins.repo 以将其更改为 https。不幸的是,问题还不止于此,至少在 RHEL 7.9 上,根颁发者(Let's Encrypt R3)默认不在受信任的证书存储中。您可以使用https://www.ssllabs.com/ssltest/analyze.html?d=pkg.jenkins.io 之类的服务来验证 jenkins.io 证书是否确实有效。证书和链实际上是有效的,但是颁发者是 R3,它被其他所有人(Mozilla、Apple、Android、Java、Microsoft)信任,但不受 yum 信任。要解决此问题(2021 年 9 月 24 日之后),您需要更新 ca-certificates

yum upgrade ca-certificates

【讨论】:

  • 就是这样。迁移到 https 并更新 ca-certificate 包为我做了这件事
【解决方案2】:

我已找到解决此错误的方法。

编辑您的 /etc/yum.repos.d/jenkins.repo 文件

[jenkins]
name=Jenkins
baseurl=http://pkg.jenkins.io/redhat
gpgcheck=1

[jenkins]
name=Jenkins
baseurl=https://pkg.jenkins.io/redhat
gpgcheck=1

尝试 yum 更新。 它可能会返回 SSL 错误。 如果是这样,请编辑您的 /etc/yum.conf ,添加以下行:

sslverify=false

现在应该可以了。

如果您不希望自签名证书在您的 yum 上工作,请记住再次将 sslverify 设置为 true。

【讨论】:

  • 但是pkg.jenkins.io 的证书没有问题。它没有像 Curl 声称的那样过期,Chrome,whatsmychaincert.com/?pkg.jenkins.io 同意它没有过期。所以真正的问题是为什么 Curl 认为它已经过期了?关闭 sslverify 是不安全的,实际上并不能解决问题,只能解决问题。
  • 使用 sudo yum upgrade ca-certificates 代替 sslverify=false
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-02-19
  • 1970-01-01
  • 1970-01-01
  • 2017-10-27
  • 2017-09-01
  • 2019-11-04
  • 2012-07-10
相关资源
最近更新 更多