我无法正确重建 /etc/apt/trusted.gpg 密钥环:
$ sudo rm /etc/apt/trusted.gpg
rm: remove regular file ‘/etc/apt/trusted.gpg’? y
$ sudo apt-key update 2>&1 | egrep "gpg:.*(invalid|failed)"
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_get_keyblock failed: eof
$ apt-key list >/dev/null
gpg: [don't know]: invalid packet (ctb=01)
gpg: keydb_search_next failed: invalid packet
编辑 1:我发现这个 pb。与中的钥匙圈相关/etc/apt/trusted.gpg.d/
,所以我用它重新创建了它们add-apt-repository
:
$ sudo mv /etc/apt/trusted.gpg.d /etc/apt/trusted.gpg.d.BACKUP
$ sudo mkdir /etc/apt/trusted.gpg.d
$ time awk -F / '/^deb .*ppa.launchpad.net/{print "sudo add-apt-repository -y ppa:"$4"/"$5}' /etc/apt/sources.list.d/*.list | sh -x
+ sudo add-apt-repository -y ppa:aims/sagemath
gpg: keyring `/tmp/tmpv9cab2oz/secring.gpg' created
gpg: keyring `/tmp/tmpv9cab2oz/pubring.gpg' created
gpg: requesting key BE796FF2 from hkp server keyserver.ubuntu.com
gpg: /tmp/tmpv9cab2oz/trustdb.gpg: trustdb created
gpg: key BE796FF2: public key "Launchpad PPA for AIMS" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
+ sudo add-apt-repository -y ppa:apandada1/brightness-controller
gpg: keyring `/tmp/tmp74ndc3fv/secring.gpg' created
gpg: keyring `/tmp/tmp74ndc3fv/pubring.gpg' created
gpg: requesting key A7803E3B from hkp server keyserver.ubuntu.com
gpg: /tmp/tmp74ndc3fv/trustdb.gpg: trustdb created
gpg: key A7803E3B: public key "Launchpad PPA for Archisman Panigrahi" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
...
gpg: /tmp/tmp49wcgvjj/trustdb.gpg: trustdb created
gpg: key EEAD66BD: public key "Launchpad PPA for Xu Zhen" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
OK
real 6m20.794s
user 5m49.528s
sys 0m17.888s
$ apt-key list >/dev/null
gpg: keyblock resource `/etc/apt/trusted.gpg.d/notepadqq-team-notepadqq.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/nowrep-qupzilla.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/octave-stable.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/openlp-core-release.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/otto-kesselgulasch-gimp.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pinta-maintainers-pinta-stable.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pmjdebruijn-gnoduino-release.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/privoox-privoox.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/pypy-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/rvm-smplayer.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/sbates-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/smathot-cogscinl.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/ufleisch-kid3.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/unit193-inxi.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/wseverin-ppa.gpg': resource limit
gpg: keyblock resource `/etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg': resource limit
经过一番挖掘,我发现 GnuPG v1(Ubuntu Trust APT 包的依赖项)无法处理超过 40 个密钥环,也就是说,它无法处理超过 39 个密钥环/etc/apt/trusted.gpg.d/
(根据:https://askubuntu.com/a/508337/426176然后 :https://www.mail-archive.com/[电子邮件保护]/msg23302.html)
编辑 2 :我已删除以下中的 10 个重复键/etc/apt/trusted.gpg.d/
:
$ sudo fdupes -rnASd /etc/apt/trusted.gpg.d
[1] /etc/apt/trusted.gpg.d/guardianproject-fdroidserver.gpg
[2] /etc/apt/trusted.gpg.d/guardianproject-ppa.gpg
Set 1 of 6, preserve files [1 - 2, all] (916 bytes each): 2
[-] /etc/apt/trusted.gpg.d/guardianproject-fdroidserver.gpg
[+] /etc/apt/trusted.gpg.d/guardianproject-ppa.gpg
[1] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-3.gpg
[2] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-4.gpg
[3] /etc/apt/trusted.gpg.d/jonathonf-texlive.gpg
[4] /etc/apt/trusted.gpg.d/jonathonf-vim.gpg
[5] /etc/apt/trusted.gpg.d/jonathonf-vlc.gpg
Set 2 of 6, preserve files [1 - 5, all] (1135 bytes each): 2
[-] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-3.gpg
[+] /etc/apt/trusted.gpg.d/jonathonf-ffmpeg-4.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-texlive.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-vim.gpg
[-] /etc/apt/trusted.gpg.d/jonathonf-vlc.gpg
[1] /etc/apt/trusted.gpg.d/noobslab-apps.gpg
[2] /etc/apt/trusted.gpg.d/noobslab-mint.gpg
[3] /etc/apt/trusted.gpg.d/noobslab-themes.gpg
Set 3 of 6, preserve files [1 - 3, all] (943 bytes each): 2
[-] /etc/apt/trusted.gpg.d/noobslab-apps.gpg
[+] /etc/apt/trusted.gpg.d/noobslab-mint.gpg
[-] /etc/apt/trusted.gpg.d/noobslab-themes.gpg
[1] /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
[2] /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg
Set 4 of 6, preserve files [1 - 2, all] (6570 bytes each): 1
[+] /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
[-] /etc/apt/trusted.gpg.d/webupd8team-y-ppa-manager.gpg
[1] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg
[2] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
Set 5 of 6, preserve files [1 - 2, all] (1313 bytes each): 2
[-] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-ppa.gpg
[+] /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
[1] /etc/apt/trusted.gpg.d/mc3man-mpv-tests.gpg
[2] /etc/apt/trusted.gpg.d/mc3man-trusty-media.gpg
Set 6 of 6, preserve files [1 - 2, all] (527 bytes each): 2
[-] /etc/apt/trusted.gpg.d/mc3man-mpv-tests.gpg
[+] /etc/apt/trusted.gpg.d/mc3man-trusty-media.gpg
将我所有的 gpg launchpad ppa 密钥添加到同一个/etc/apt/trusted.gpg
密钥环中是唯一的解决方案吗?它似乎有点不太有序?
编辑 3:现在我有 16 个额外的(被拒绝的)密钥/etc/apt/trusted.gpg.d/
,所以我要将它们移动到/etc/apt/trusted.gpg
密钥环:
$ apt-key list 2>&1 >/dev/null | awk -F"[\`']" '/resource limit/{print "sudo apt-key add "$2" 2>/dev/null ; sudo \\rm -vf "$2}' | sh -x
+ sudo apt-key add /etc/apt/trusted.gpg.d/pypy-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/pypy-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/pypy-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/rvm-smplayer.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/rvm-smplayer.gpg
removed ‘/etc/apt/trusted.gpg.d/rvm-smplayer.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/sbates-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/sbates-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/sbates-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg
removed ‘/etc/apt/trusted.gpg.d/skunk-pepper-flash.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/smathot-cogscinl.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/smathot-cogscinl.gpg
removed ‘/etc/apt/trusted.gpg.d/smathot-cogscinl.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg
removed ‘/etc/apt/trusted.gpg.d/stebbins-handbrake-releases.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg
removed ‘/etc/apt/trusted.gpg.d/stefanobalocco-multimedia.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/team-xbmc-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg
removed ‘/etc/apt/trusted.gpg.d/timchen119-bluez5-trusty.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg
removed ‘/etc/apt/trusted.gpg.d/ubuntu-mate-dev-trusty-mate.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg
removed ‘/etc/apt/trusted.gpg.d/ubuntu-toolchain-r-test.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/ufleisch-kid3.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/ufleisch-kid3.gpg
removed ‘/etc/apt/trusted.gpg.d/ufleisch-kid3.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/unit193-inxi.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/unit193-inxi.gpg
removed ‘/etc/apt/trusted.gpg.d/unit193-inxi.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg
removed ‘/etc/apt/trusted.gpg.d/webupd8team-tor-browser.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/wseverin-ppa.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/wseverin-ppa.gpg
removed ‘/etc/apt/trusted.gpg.d/wseverin-ppa.gpg’
+ sudo apt-key add /etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg
+ sudo rm -vf /etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg
removed ‘/etc/apt/trusted.gpg.d/xuzhen666-gnome-mpv.gpg’
$ apt-key list >/dev/null
$
问题已解决。
答案1
不是要苛刻,但你有太多的 ppa,而且你需要摆脱一些解决您的问题。抱歉 :(
很多人使用ppa-purge
,但我不能 100% 确定这会删除密钥,因此您必须在清除 ppa 后进行检查,以确保密钥也消失了。
尝试查看某些 ppa 是否使用相同的密钥编号。如果是这样,那么您可以删除重复的密钥以帮助您将您的数字控制在 40 以下。Ubuntu mate ppas 可能使用相同的密钥,因此如果找到重复的密钥,您可以删除它。
此外,一些 ppa(如 webupd8 ppa,可能也使用相同的密钥)不再维护,因此您可以删除这些 ppa。不幸的是,webupd8 ppas 自 2017 年以来尚未更新。
臭鼬辣椒闪光ppa自 2016 年以来没有更新此外,你甚至不需要 pepperflash 安装程序 ppa,因为你所要做的就是在软件和更新中启用 Canonical 存储库然后运行:sudo apt update; sudo apt install adobe-flashplugin
。另请参见此处。
这privoox ppa自 2016 年以来也没有更新过。
这些只是我拥有的 ppa使用谷歌检查。您需要使用 Google 自己检查其余内容,看看哪些 ppa 仍然有效,哪些 ppa 不再维护。