【问题标题】:Ansible modules not working for adding a git-ppa - "W:GPG error - NO_PUBKEY" errorAnsible 模块无法添加 git-ppa - “W:GPG 错误 - NO_PUBKEY”错误
【发布时间】:2019-06-14 10:54:57
【问题描述】:

几个月前,我的以下任务的剧本运行成功。

- name: add git ppa repo
  apt_repository:
    repo: deb-src http://ppa.launchpad.net/git-core/ppa/ubuntu {{ ansible_lsb.codename }} main
    state:  present
  become: yes

- name: Add git apt key by id from a keyserver
  apt_key:
    keyserver: keyserver.ubuntu.com
    id: A1715D88E1DF1F24
    state: present
  become: yes

当我现在运行它时,它会因错误而中断

W:GPG 错误:http://ppa.launchpad.net/git-core/ppa/ubuntu bionic InRelease:无法验证以下签名,因为公钥不可用:NO_PUBKEY A1715D88E1DF1F24 E:存储库“http://ppa.launchpad.net/git-core/ppa/ubuntubionic InRelease”未签名。

我可以通过运行
sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com A1715D88E1DF1F24

来修复错误

如果我不想将其作为 RAW/SHELL ansible 命令运行。有没有其他方法可以修复它,我想知道 ansible apt_key 部分出了什么问题,我相信它之前在做同样的事情并且正在工作。谢谢!

【问题讨论】:

  • 颠倒任务顺序?
  • 谢谢,钟表网。是的,这也不起作用。

标签: ubuntu ansible apt


【解决方案1】:

我在 Win Bash 中的 Ubuntu 18.04 也有类似的问题,这个解决方案对我有用:

Err:2 http://archive.ubuntu.com/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Hit:6 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
Err:5 http://ppa.launchpad.net/ondrej/php/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 4F4EA0AAE5267A6C
Err:6 http://ppa.launchpad.net/webupd8team/java/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
Hit:7 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
Err:3 http://security.ubuntu.com/ubuntu bionic-security InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Get:1 http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic InRelease [15.9 kB]
Err:4 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 3B4FE6ACC0B21F32
Err:7 http://ppa.launchpad.net/webupd8team/y-ppa-manager/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY C2518248EEA14886
Err:1 http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EA8CACC073C3DB2A
  1. 我尝试使用 apt-get update e 得到错误:无法验证,因为公钥不可用:NO_PUBKEY 3B4FE6ACC0B21F32

  2. 所以,我使用 curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xREPLACENUMBERPUBKEY" | sudo apt-key add 将 0x3B4FE6ACC0B21F32 替换为 0x

  3. 示例:curl -sL "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3B4FE6ACC0B21F32" | sudo apt-key 添加

推荐人:https://github.com/Microsoft/WSL/issues/3286#issuecomment-402594992

【讨论】:

    猜你喜欢
    • 2018-09-28
    • 1970-01-01
    • 2018-12-22
    • 1970-01-01
    • 2014-06-04
    • 1970-01-01
    • 2014-08-01
    • 1970-01-01
    相关资源
    最近更新 更多