[root@###~]# yum install jenkins
Loaded plugins: fastestmirror, product-id, search-disabled-repos, subscription-manager
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
- base: mirror.myfahim.com
- extras: centos-hcm.viettelidc.com.vn
- updates: mirror.tino.org
base | 3.6 kB 00:00:00
extras | 2.9 kB 00:00:00
http://pkg.jenkins.io/redhat-stable/repodata/repomd.xml: [Errno 14] HTTPS Error 301 – Moved Permanently
Trying other mirror.
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
I have found a solution for this error.
edit your /etc/yum.repos.d/jenkins.repo file from
to
Try to yum update.
It will probably return an SSL error.
If so, edit your /etc/yum.conf , add this line:
Now it should work.
Remember to set sslverify to true again if you don’t want self-signed certificates to work on your yum.
It looks like the jenkins.repo file currently distributed by jenkins.io, is configured to use
http
, nothttps
. (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 tohttps
. 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 updateca-certificates
I have found a solution for this error.
ALL REPOS URL MUST HTTPS.
edit all your /etc/yum.repos.d/REPONAMES.repo file from
to
Try to yum update. It will probably return an SSL error. If so, edit your /etc/yum.conf , add this line:
Now it should work.
Remember to set sslverify to true again if you don’t want self-signed certificates to work on your yum.