Ubuntu安装Jenkins是报错:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY XXXXXXXXXXX

  我使用Ubuntu16.04安装Jenkins时,按照官网的要求,步骤如下(https://pkg.jenkins.io/debian-stable/):  

复制代码
    # 添加Key
    sudo wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
   # 添加包源,可以打开/etc/apt/sources.list,添加一行:deb https://pkg.jenkins.io/debian-stable binary/
   # sudo vim /etc/apt/sources.list
   # 或者使用下面的命令追加到包源文件
   sudo sh -c 'echo deb http://pkg.jenkins.io/debian-stable binary/ > /etc/apt/sources.list.d/jenkins.list'
   # 更新包源
   sudo apt-get update
   # 安装jenkins
   sudo apt-get install jenkins
复制代码

  但是在执行更新包源时,报错了:The following signatures couldn't be verified because the public key is not available: NO_PUBKEY FCEF32E745F2C3D5

   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
   W: The repository 'http://pkg.jenkins.io/debian-stable binary/ Release' is not signed.
   N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
   N: See apt-secure(8) manpage for repository creation and user configuration details.

  这个是说由于没有公钥,无法验证下列签名,解决办法是添加上面的公钥,比如上面的信息说我的公钥是:FCEF32E745F2C3D5

  于是我就执行下面的命令:  

    # 最后的参数就是公钥
   sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FCEF32E745F2C3D5

  执行完之后,再执行 sudo apt-get update 就不会报错了,但是可能有其它的错,比如连接失败等等,多试几次就好了。

  不过最后的install十次有9次会失败,看人品了。

 

posted @   没有星星的夏季  阅读(3336)  评论(0编辑  收藏  举报
编辑推荐:
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
阅读排行:
· 开源Multi-agent AI智能体框架aevatar.ai,欢迎大家贡献代码
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
点击右上角即可分享
微信分享提示