【问题标题】:GPG error: https://cli.github.com/packages stable InRelease: EXPKEYSIG C99B11DEB97541F0 [closed]GPG 错误:https://cli.github.com/packages stable InRelease:EXPKEYSIG C99B11DEB97541F0 [关闭]
【发布时间】:2022-10-23 10:47:32
【问题描述】:

尝试使用 apt 包管理器更新 GitHub CLI 失败并出现以下错误:

Failed to fetch https://cli.github.com/packages/dists/stable/InRelease: The following signatures couldn't be verified because the public key is not available: EXPKEYSIG C99B11DEB97541F0
GPG error: The following signatures were invalid: EXPKEYSIG C99B11DEB97541F0

【问题讨论】:

    标签: linux git repository github-cli


    【解决方案1】:

    您看到此错误是因为此证书的颁发者 (https://github.com/vilmibm) 已允许它过期。他们stated 表示这可能不会很快解决,或者根本不会解决。您的选择是:

    1. 等待证书更新,让一切恢复正常。
    2. 忽略错误并使用sudo apt install gh --allow-unauthenticated 安装软件包(请注意,从安全角度来看,这不是一个好主意)
    3. 下载the latest release 并手动安装,而不是使用apt。如果你这样做,你还应该从你的包列表中删除源,这样你就不会在更新时看到错误:sudo apt-key del C99B11DEB97541F0 && sudo rm /etc/apt/sources.list.d/github-cli.list

      2022 年 9 月 7 日更新:

      现在已经为这个包颁发了一个新的证书。根据下面 FourDollars 和 Adam Sherwood 的回答,您可以通过关注 these instructions 来修复/更新。

    【讨论】:

      【解决方案2】:

      您可以再次运行以下命令来修复 GPG 错误。

      curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg 
      && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg 
      && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null 
      && sudo apt update 
      && sudo apt install gh -y
      

      https://github.com/cli/cli/blob/trunk/docs/install_linux.md#debian-ubuntu-linux-raspberry-pi-os-apt 上注明。

      【讨论】:

        【解决方案3】:

        我目前正在运行 Pop_os (20.04) 并且必须执行以下操作(注意:前两行正在撤消先前在文档中使用新接受的方法的尝试):

        sudo rm /usr/share/keyrings/githubcli-archive-keyring.gpg 
        && sudo rm /etc/apt/sources.list.d/github-cli.list 
        && sudo apt-key del C99B11DEB97541F0 
        && sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 23F3D4EA75716059 
        && sudo apt-add-repository https://cli.github.com/packages 
        && sudo apt install gh -y
        

        来源:https://github.com/cli/cli/issues/5810#issuecomment-1240200365

        【讨论】:

          猜你喜欢
          • 1970-01-01
          • 2018-09-09
          • 1970-01-01
          • 2020-09-29
          • 2022-08-13
          • 1970-01-01
          • 1970-01-01
          • 2021-01-13
          • 2010-09-10
          相关资源
          最近更新 更多