简体   繁体   English

在centos中安装jenkins时获取403禁止的异常

[英]Getting 403 forbidden exception while installing jenkins in centos

while trying to execute the following command in centos I am getting the below error . 尝试在centos中执行以下命令时,出现以下错误。 what I am trying to do is to install jenkins in the centos. 我想做的是在centos中安装jenkins。 can some one help on this. 可以对此有所帮助。 Below is the code snipper I am trying to excute 以下是我尝试执行的代码窃听器

 [vagrant@testbox01 scripts]$ !su
sudo wget -O /etc/yum.repos.d/jenkins.repo http://pkg.jenkins-ci.org/redhat/jenkins.repo
--2019-02-22 06:31:53--  http://pkg.jenkins-ci.org/redhat/jenkins.repo
Resolving pkg.jenkins-ci.org (pkg.jenkins-ci.org)... 52.202.51.185
Connecting to pkg.jenkins-ci.org (pkg.jenkins-ci.org)|52.202.51.185|:80... connected.
HTTP request sent, awaiting response... 403 Forbidden
2019-02-22 06:31:53 ERROR 403: Forbidden.

As a workaround you can just create the file /etc/yum.repos.d/jenkins.repo instead of downloading that and put below content in it. 作为解决方法,您可以仅创建文件/etc/yum.repos.d/jenkins.repo而不是下载该文件并将其放在内容下方。

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

Then you can use below commands to install jenkins: 然后,您可以使用以下命令来安装jenkins:

rpm --import https://pkg.jenkins.io/redhat/jenkins.io.key
yum install jenkins

You can also this link for more information. 您也可以通过链接获取更多信息。

There are a multitude of reasons why you may be getting a 403 on this request. 有很多原因可能导致您在此请求中收到403。 Try an alternate Jenkins mirror for the resource, like: 尝试为资源使用备用的Jenkins镜像,例如:

https://pkg.jenkins.io/redhat/jenkins.repo

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM