AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 417488
Accepted
Pierre-Antoine Guillaume
Pierre-Antoine Guillaume
Asked: 2018-01-17 03:36:43 +0800 CST2018-01-17 03:36:43 +0800 CST 2018-01-17 03:36:43 +0800 CST

如何恢复(或重置)*.debian.org 的 GPG 密钥?

  • 772

所以我想我删除或损坏了我为 *.debian.org 拥有的 gpg 密钥,这使得apt-get update产量

Ign http://ftp.fr.debian.org jessie InRelease
Réception de : 1 http://security.debian.org jessie/updates InRelease [63,1 kB]
Réception de : 2 http://ftp.debian.org jessie-backports InRelease [166 kB]
Réception de : 3 http://ftp.fr.debian.org jessie Release.gpg [2 434 B]
Ign http://security.debian.org jessie/updates InRelease
Réception de : 4 http://ftp.fr.debian.org jessie-updates InRelease [145 kB]
Ign http://security.debian.org jessie/updates/main Sources/DiffIndex
Ign http://ftp.debian.org jessie-backports InRelease
Ign http://security.debian.org jessie/updates/main amd64 Packages/DiffIndex
Err http://ftp.fr.debian.org jessie-updates InRelease

Réception de : 5 http://ftp.debian.org jessie-backports/main amd64 Packages/DiffIndex [27,8 kB]
Atteint http://ftp.fr.debian.org jessie Release
Ign http://ftp.fr.debian.org jessie Release
Réception de : 6 http://ftp.debian.org jessie-backports/contrib amd64 Packages/DiffIndex [25,3 kB]
Ign http://ftp.fr.debian.org jessie/main Sources/DiffIndex
Ign http://ftp.fr.debian.org jessie/main amd64 Packages/DiffIndex
Atteint http://security.debian.org jessie/updates/main Translation-en
Atteint http://security.debian.org jessie/updates/main Sources
Atteint http://security.debian.org jessie/updates/main amd64 Packages
Atteint http://ftp.debian.org jessie-backports/contrib Translation-en
Atteint http://ftp.fr.debian.org jessie/main Translation-fr
Atteint http://ftp.fr.debian.org jessie/main Translation-en
Ign http://security.debian.org jessie/updates/main Translation-fr_FR
Ign http://security.debian.org jessie/updates/main Translation-fr
Atteint http://ftp.debian.org jessie-backports/main Translation-en
Atteint http://ftp.fr.debian.org jessie/main Sources
Atteint http://ftp.fr.debian.org jessie/main amd64 Packages
Ign http://ftp.fr.debian.org jessie/main Translation-fr_FR
Ign http://ftp.debian.org jessie-backports/contrib Translation-fr_FR
Ign http://ftp.debian.org jessie-backports/contrib Translation-fr
Ign http://ftp.debian.org jessie-backports/main Translation-fr_FR
Ign http://ftp.debian.org jessie-backports/main Translation-fr
430 ko réceptionnés en 2s (175 ko/s)
Lecture des listes de paquets…
W: Erreur de GPG : http://security.debian.org jessie/updates InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY (SOME hexadecimals) NO_PUBKEY (SOME hexadecimals)
W: Erreur de GPG : http://ftp.debian.org jessie-backports InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY (SOME hexadecimals) NO_PUBKEY (SOME hexadecimals)
W: Une erreur s'est produite lors du contrôle de la signature. Le dépôt n'est pas mis à jour et les fichiers d'index précédents seront utilisés. Erreur de GPG : http://ftp.fr.debian.org jessie-updates InRelease : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY (SOME hexadecimals) NO_PUBKEY (SOME hexadecimals)

W: Erreur de GPG : http://ftp.fr.debian.org jessie Release : Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible : NO_PUBKEY (SOME hexadecimals) NO_PUBKEY (SOME hexadecimals) NO_PUBKEY (SOME hexadecimals)
W: Impossible de récupérer http://ftp.fr.debian.org/debian/dists/jessie-updates/InRelease  

W: Le téléchargement de quelques fichiers d'index a échoué, ils ont été ignorés, ou les anciens ont été utilisés à la place.

“Les signatures suivantes n'ont pas pu être vérifiées car la clé publique n'est pas disponible”大致翻译为“无法检查以下签名,因为公钥不可用”。

我怎样才能挽回这些错误?

更新:我做了

# wget http://ftp.fr.debian.org/debian/pool/main/d/debian-archive-keyring/debian-archive-keyring_2017.5~deb8u1_all.deb
# dpkg -i debian-archive-keyring_2017.5~deb8u1_all.deb

但什么都没有改变。我怀疑导致整个事情的原因是

# curl -s https://www.dotdeb.org/dotdeb.gpg | apt-key remove

删除几分钟前我刚刚添加的 gpg 密钥。

apt gpg
  • 2 2 个回答
  • 7050 Views

2 个回答

  • Voted
  1. Best Answer
    telcoM
    2018-01-17T05:25:23+08:002018-01-17T05:25:23+08:00

    由于您已经重新安装了debian-archive-keyring软件包,实际的密钥文件现在应该就位了。但是重新安装未能将密钥重新添加为受信任的,可能是因为postinst包中脚本中的某些条件似乎与从 Debian 挤压到 jessie 的迁移有关。

    您可能需要这样做(或非常类似的事情):

    # cd /etc/apt/trusted.gpg.d
    # for i in *.gpg ; do apt-key add $i; done
    

    如果实际的密钥仍然丢失,蛮力的方法是手动提取包:

    mkdir /tmp/workdir
    cd /tmp/workdir
    ar x /some/where/debian-archive-keyring_2017.5~deb8u1_all.deb
    tar xvf data.tar.xz
    

    现在您绝对应该在目录中有密钥文件/tmp/workdir/etc/apt/trusted.gpg.d/。将它们复制到位,然后使用apt-key add上面建议的命令。

    • 1
  2. Stephen Kitt
    2018-01-17T03:40:08+08:002018-01-17T03:40:08+08:00

    下载debian-archive-keyring(此链接到 Jessie 版本),并手动安装(以 root 身份):

    dpkg -i debian-archive-keyring_2017.5~deb8u1_all.deb
    

    这将恢复密钥/etc/apt/trusted.gpg.d,您应该能够apt再次运行。

    • 0

相关问题

  • 尝试安装 debian 软件包 npm,使 apt-get 删除 libssl-dev

  • 如何下载软件包而不是使用 apt-get 命令安装它?

  • 为什么有时需要手动导入密钥?

  • /etc/apt/sources.list.d 比 /etc/apt/sources.list 有什么好处

  • gpg —list-keys 命令在将私钥导入全新安装后输出 uid [未知]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    ssh 无法协商:“找不到匹配的密码”,正在拒绝 cbc

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    如何卸载内核模块“nvidia-drm”?

    • 13 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Wong Jia Hau ssh-add 返回:“连接代理时出错:没有这样的文件或目录” 2018-08-24 23:28:13 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST
  • Martin Hope
    Bagas Sanjaya 为什么 Linux 使用 LF 作为换行符? 2017-12-20 05:48:21 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve