我无法正确重建 /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/[email protected]/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 启动板 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
$
问题已解决。
不要苛刻,但你有太多的 ppa,你需要摆脱一些来解决你的问题。对不起 :(
很多人都在使用
ppa-purge
,但我不能 100% 确定这会删除密钥,因此您必须在清除 ppa 后检查以确保密钥也消失了。尝试查看是否某些 ppa 使用相同的密钥号。如果是这样,那么您可以删除重复的密钥以帮助您获得 40 以下的号码。Ubuntu mate ppas 可能使用相同的密钥,因此如果您找到一个重复项,您可能会删除该密钥。
此外,不再维护一些像 webupd8 ppas(可能也使用相同的密钥)这样的 ppas,因此您可以删除这些 ppas。不幸的是,webupd8 ppas 自 2017 年以来一直没有更新。
skunk pepperflash ppa自 2016 年以来一直没有更新,此外,您甚至不需要 pepperflash 安装程序 ppa,因为您所要做的就是在 Software & Updates 中启用 Canonical 存储库,然后运行:
sudo apt update; sudo apt install adobe-flashplugin
. 也见这里。privoox ppa自 2016 年以来也没有更新。
这些只是我用谷歌检查的 ppa 。您将需要使用 Google 自己检查其余这些内容,以查看哪些 ppa 仍然处于活动状态,哪些不再维护。