【问题标题】:Getting 403 forbidden exception while installing jenkins in centos在centos中安装jenkins时出现403禁止异常
【发布时间】:2019-02-22 11:40:43
【问题描述】:

尝试在 centos 中执行以下命令时,出现以下错误。我想做的是在centos中安装jenkins。有人可以帮忙吗?下面是我要执行的代码片段

 [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.

【问题讨论】:

  • 请显示代码和/或说明错误。请不要使用图片链接。问题中缺少文本。图片上的文字太小,有些人看不懂。图像上的文本无法被搜索引擎索引以供未来的访问者使用。另见Why not upload images of code on SO when asking a question?
  • 你试过从镜子里取回它吗?喜欢pkg.jenkins.io/redhat/jenkins.repo
  • 代码开头的!su 是什么?仅对sudo .....使用命令
  • @RomeoNinov 它是搜索先前执行的命令并再次执行相同命令的命令(!su),例如,如果我们执行命令 sudo .....,cd... ,ls ..顺序,我们想再次执行 sudo 命令然后我们需要使用以下命令!(搜索字符串)
  • 您是否使用代理访问互联网?

标签: linux jenkins centos


【解决方案1】:

作为一种解决方法,您可以只创建文件/etc/yum.repos.d/jenkins.repo 而不是下载该文件并将下面的内容放入其中。

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

然后您可以使用以下命令安装 jenkins:

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

您也可以this链接了解更多信息。

【讨论】:

    【解决方案2】:

    您可能会在此请求中收到 403 的原因有很多。尝试为资源使用备用 Jenkins 镜像,例如:

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

    【讨论】:

      猜你喜欢
      • 2019-05-25
      • 1970-01-01
      • 1970-01-01
      • 2018-07-31
      • 2017-07-10
      • 1970-01-01
      • 1970-01-01
      • 2015-10-29
      • 1970-01-01
      相关资源
      最近更新 更多