linuxaptubuntu-20.10keyserver

GPG gives invalid packet (ctb=0a) error when trying to import public keys


Trying to update gives me an error saying public keys are not available: enter image description here

So I tried to import the keys using apt-key, which raises this invalid packet error: enter image description here


Solution

  • So I managed to fix this myself.

    Issue:

    gpg keyring is damaged

    Soulution:

    1. Delete /etc/apt/trusted.gpg and all .gpg files in /etc/apt/trusted.gpg.d/
    2. Download launchpad-getkeys binary and execute it as sudo