skip to Main Content
[root@###~]# yum install jenkins
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

Loading mirror speeds from cached hostfile

One of the configured repositories failed (Jenkins-stable),
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=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

failure: repodata/repomd.xml from jenkins: [Errno 256] No more mirrors to try.
http://pkg.jenkins.io/redhat-stable/repodata/repomd.xml: [Errno 14] HTTPS Error 301 – Moved Permanently

Please help me out

3

Answers


  1. I have found a solution for this error.

    edit your /etc/yum.repos.d/jenkins.repo file from

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

    to

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

    Try to yum update.
    It will probably return an SSL error.
    If so, edit your /etc/yum.conf , add this line:

    sslverify=false
    

    Now it should work.

    Remember to set sslverify to true again if you don’t want self-signed certificates to work on your yum.

    Login or Signup to reply.
  2. It looks like the jenkins.repo file currently distributed by jenkins.io, is configured to use http, not https. (C’mon, people, seriously? This is 2021.) Fortunately it’s very easy for you to edit /etc/yum.repos.d/jenkins.repo to change it to https. Unfortunately, that’s not where the problems stop, at least on RHEL 7.9, the root issuer (Let’s Encrypt R3) is not in the trusted cert store by default. You can verify that the jenkins.io cert is actually valid by using a service such as https://www.ssllabs.com/ssltest/analyze.html?d=pkg.jenkins.io. The cert and chain is actually valid, but the issuer is R3, which is trusted by everyone else (Mozilla, Apple, Android, Java, Microsoft), but is not trusted by yum. To resolve this issue (after Sep 24, 2021) you need to update ca-certificates

    yum upgrade ca-certificates
    
    Login or Signup to reply.
  3. I have found a solution for this error.

    ALL REPOS URL MUST HTTPS.

    HTTP -> HTTPS
    

    edit all your /etc/yum.repos.d/REPONAMES.repo file from

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

    to

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

    Try to yum update. It will probably return an SSL error. If so, edit your /etc/yum.conf , add this line:

    sslverify=false
    

    Now it should work.

    Remember to set sslverify to true again if you don’t want self-signed certificates to work on your yum.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search