在 CentOS 8 上安装 jenkins 之前,需要确定已经正确安装了 JDK。 安装 JDK 的方法,请参考:CentOS 8 安装 OpenJDK 11 设定仓库和安装 在安装 Jenkins 之前,需要在你的操作系统中设置好仓库。 依次运行下面的命令: sudo wget -O /etc/yum.repos.d/jenkins.repo https://pkg.jenkins.io/redhat-stable/jenkins.repo sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io.key sudo dnf update sudo dnf install jenkins sudo systemctl daemon-reload CentOS-jenkins-install-01910×527 8.97 KB 运行 Jenkins 使用下面的命令来运行: systemctl start jenkins 随后可以使用 systemctl status jenkins 来查看运行的状态。 CentOS-jenkins-install-02927×527 35.1 KB 校验安装 如果一切顺利,可以通过 IP 地址,访问 8080 端口。 CentOS-jenkins-install-03941×585 29.8 KB 如果你能够看到上面的界面,就说明你的 Jenkins 已经安装成功了。 https://www.ossez.com/t/centos-8-jenkins/706