在 Ubuntu 上安装 Jenkins 告诉我“包‘jenkins’没有安装候选”

Edw*_*uay 1 jenkins ubuntu-20.04

我需要在 Ubuntu 20.4.1 上安装 Jenkins。

我已经完成了以下工作:

  • apt-get -y install openjdk-8-jdk (这是 Java 14.0.1)
  • wget -q -O - http://pkg.jenkins-ci.org/debian-stable/jenkins-ci.org.key | apt-key add - (回复“OK”)
  • sudo sh -c 'echo deb https://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list' (文件存在并在其中包含这一行)
  • sudo apt update, 回复:
Hit:1 http://de.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://de.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://de.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://de.archive.ubuntu.com/ubuntu focal-security InRelease
Ign:5 https://pkg.jenkins.io/debian-stable binary/ InRelease
Get:6 https://pkg.jenkins.io/debian-stable binary/ Release [2,044 B]
Get:7 https://pkg.jenkins.io/debian-stable binary/ Release.gpg [833 B]
Ign:7 https://pkg.jenkins.io/debian-stable binary/ Release.gpg
Reading package lists... Done
W: GPG error: https://pkg.jenkins.io/debian-stable binary/ Release: The following signatures couldn't 
be verified because the public key is not available: NO_PUBKEY FCEF32E745F2C3D5
E: The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed.
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.
Run Code Online (Sandbox Code Playgroud)
  • sudo apt install jenkins, 回复:
root@ubuntu-server:~# sudo apt install jenkins
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package jenkins is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'jenkins' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

我必须做什么才能apt找到 Jenkins 软件包以便安装它?

Mic*_*ton 5

您正在遵循非官方或过时的说明。

因此,您导入了错误的 GPG 密钥。Jenkins 于 2020 年 4 月 16 日更改了他们的 GPG 密钥。您需要按照当前官方说明导入正确的密钥。

wget -q -O - https://pkg.jenkins.io/debian/jenkins.io.key | sudo apt-key add -
Run Code Online (Sandbox Code Playgroud)