无法在 Ubuntu 20.04 上安装 Jenkins

Unable to install Jenkins on Ubuntu 20.04

我正在尝试在我的 Ubuntu EC2 实例上安装 Jenkins,我执行了以下安装步骤但无法安装。

$sudo 更新 $sudo apt install openjdk-8-jdk $wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key 添加 - $sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' $sudo apt update <---------- (这里我遇到以下错误)

root@ip-172-31-44-187:~# sudo apt update Ign:1 https://pkg.jenkins.io/debian-stable 二进制/发布 Err:2 https://pkg.jenkins.io/debian-stable 二进制/发布 证书验证失败:证书不受信任。证书链使用过期的证书。无法握手:错误 证书验证。 [IP: 151.101.154.133 443] Hit:3 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu 焦点 InRelease Get:4 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu 焦点更新 InRelease [114 kB] Get:5 http://security.ubuntu.com/ubuntu focal-security InRelease [114 kB] Get:6 http://ap-south-1.ec2.archive.ubuntu.com/ubuntu focal-backports InRelease [101 kB] 阅读包裹清单...完成 E: 存储库 'http://pkg.jenkins.io/debian-stable binary/ Release' 没有发布文件。 N:无法安全地从这样的存储库更新,因此默认情况下禁用。 N:请参阅 apt-secure(8) 手册页以了解存储库创建和用户配置的详细信息。

是的,我昨天遇到了同样的问题,我想这是在昨天 jenkins 2.303.2 Lts 的新更新之后。

随心所欲, 升级, 适当的更新, apt get install jenkins -y .

对我有用。

当我尝试在 AWS ec2 实例 (Ubuntu 20.04) 中安装 jenkins 时,我遇到了同样的问题。以下步骤对我有帮助。

  1. 更新Ubuntu 软件包和所有已安装的应用程序
sudo apt-get update -y
sudo apt-get upgrade -y
  1. 下一步,安装JDK
sudo apt install openjdk-11-jdk -y
  1. 验证Java版本
java -version
  1. 为 jenkins 安装添加 gpg 密钥
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | apt-key add -
  1. 将存储库地址添加到我们的 /etc/apt/sources.list.d 文件
sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > \
e>     /etc/apt/sources.list.d/jenkins.list'
  1. 再次更新我们的包裹清单
sudo apt-get update -y
  1. 安装詹金斯
sudo apt-get install jenkins -y

它很有魅力!

我没有使用 apt-get upgrade 升级每个包,而是使用了: sudo apt install ca-certificates

然后: sudo apt-get update 工作得很好。

我没有使用 apt-get upgrade 升级每个包,而是使用了:sudo apt install ca-certificates 然后:sudo apt-get 更新工作正常

我在 Ubuntu 18.04

上添加 Jenkins 存储库时遇到了同样的问题

add-apt-repository 'deb https://pkg.jenkins.io/debian-stable binary/'

Ign:5 https://pkg.jenkins.io/debian-stable binary/ InRelease Err:6 https://pkg.jenkins.io/debian-stable binary/ Release Certificate verification failed: The certificate is NOT trusted. The certificate chain uses expired certificate. Could not handshake: Error in the certificate verification. [IP: 199.232.66.133 443] Hit:7 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease Reading package lists... Done E: The repository 'https://pkg.jenkins.io/debian-stable binary/ Release' does not have a Release file. N: Updating from such a repository can't be done securely, and is therefore disabled by default. N: See apt-secure(8) manpage for repository creation and user configuration details.

要解决此问题,您需要 install/update ca-certificates

sudo apt install ca-certificates

之后就可以成功添加Jenkins仓库了

我想更正提供的第一个答案。您需要 运行 apt install Jenkins -y 而不是 apt get install jenkins -y。 运行 以下命令将修复您的错误。如果您没有使用 root,请确保在以下所有命令之前添加 sudo。

apt upgrade 

apt update

apt install jenkins -y

您会发现您的 jenkins 已使用以下命令启动。

service jenkins status

上述解决方案中的 none 可能对某些人有所帮助,但这是一个愚蠢的错误! *请*阅读所有输出。就我而言,我错过了上面几行的错误,表明我没有在我的 Debian 服务器上安装“curl”(!)。因此,从 Jenkins 手册(使用 curl)复制粘贴关键安装行没有成功,因此导致所有这些不安全的错误。