Cannot import key during an update?

I have a machine that was recently updated on stable branch (kernel 6.12 KDE) apart from the new updates to Firefox and Brave. I was trying to install something new and it failed due to a keyring issue and, when I tried to first update Firefox and Brave, I got the same error of:

Preparing...
Synchronizing package databases...
Resolving dependencies...
Checking inter-conflicts...
Checking keyring...
Downloading required keys...
Error: key "8DB9F8C18DF53602" could not be imported
Error: key "B8AC08600F108CDF" could not be imported
Error: required key missing from keyring
Failed to commit transaction 

I refreshed the mirrors using sudo pacman-mirrors --continent and ran pamac update --no-aur --force-refresh.

I tried sudo pacman-key --refresh-keys but it errored

[don't know]: invalid packet (ctb=00)
keydb search failed: Inlalid packet
error reading key: invalid packet

Do I proceed to the “drastic measures” of that post or to https://wiki.manjaro.org/index.php/Pacman_troubleshooting#Errors_about_Keys or something else?

I keep the system up-to-date and don’t know why there would be a keyring issue.

Thank you.

1 Like

How (and most importantly, why) did you update your system but not those packages?

You do of course realize that this puts you in an “unsupported” state. :wink:

Sorry, I didn’t mean to be confusing; but I see, now, that it is a bit. What I mean is that the system was completely updated at the last big update; and now it shows two new updates which are Firefox and Brave. In this sense, it was recently updated apart from having run these two most recent ones that have just now appeared.

Before running those two updates, I tried to install something new which failed with a key error. So, I figured I’d try to see if Firefox and Brave would update, but they have the same error.

1 Like

I had similar issues with verification keys were not being able to download, I had to remove all cached/stored keys and run update again…

I was a little bit in a hurry, not too much that I couldn’t monitor update, but enough hurry to visit wiki and stuff to troubleshoot this…
So I just asked gemini for solution, it gave me commands, I verified what commands do, then ran them and it was fixed.

What commands did you run to solve your issue?

Those were pgp keys to verify the packages
I dont know what keys OP is having issues with… hence I didn’t include commands in first reply

gpgconf --kill all
mv ~/.gnupg ~/.gnupg.backup
gpg --list-keys
pamac upgrade
They were AUR packages

My problem was different, and with AUR

gpg: keydb_get_keyblock failed: Value not found
gpg: error writing keyring '[keyboxd]': SQL library used incorrectly
gpg: error reading '[stream]': SQL library used incorrectly
gpg: Total number processed: 0
Error: key CA262C6C83DE4D2FB28A332A3A6A4DB839EAA6D7 could not be imported
The PGP key F23275E4BF10AFC1DF6914A6DBD2CE893E2D1C87 is needed to verify libkcom
pactdisc source files.

For starters, did you try?

 sudo pacman -S archlinux-keyring manjaro-keyring    
2 Likes

Updating to archlinux-keyring 20260612-1 should solve the issue. Once your mirror(s) update, make sure it’s installed first when updating:

sudo pacman -Syu archlinux-keyring
1 Like

Thank you for the information. I must be doing something wrong because it appears to need a key to update the keyring and can’t find it. I tried the steps at this post to check the system time and they seem to have worked but still can’t find the key.

I’ve another machine on stable branch and KDE and its archlinux keyring appear to be from April and it updated without issue. Not sure what might have happened here since the last big update.

(The machine with the issue installed FocusWriter on June 4; and that seems to be all.)

Thank you

sudo pacman -S archlinux-keyring manjaro-keyring

warning: manjaro-keyring-20251003-1 is up to date -- installing
resolving dependencies...
looking for conflicting packages...
Packages (2) archlinux-keyring-20260612-1 manjaro-keyring-20251003-1
(2/2) checking keys in the keyring
downloading required keys...
asks to import pgp key 6D42BDD116E0068F from christian hesse
throws error key (above#) could not be imported
Then asks to import another key# from Philip Mueller and gives same type error.
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
no packages upgraded


For the sudo pacman -Syu archlinux-keyring
core is up to date
extra is up to date
multilib is up to date
starting full system upgrade...
resolving dependencies...
looking fro conflicting packages
Gives three (brave, firefox, and archlinux-keyring-20260612-1)
say y to install
downloading required keys
asks to import pgp key 6D42BDD116E0068F from Christian Hesse
say yes
Error: key (#above) could not be imported
Asked for 2 others and I just said no to both.
Failed. 

The problem is that you have reset the keyring database. Try to populate it with the last good values and after that try again to update those packages:

sudo pacman-key --populate archlinux manjaro
1 Like

Thank you. That results in failure because it says it needs a secret key and return message to run --init to generate it. I tried that and get:

❯ sudo pacman-key --init

gpg: [don't know]: invalid packet (ctb=00)
gpg: keydb_search_first failed: Invalid packet
==> Generating pacman master key. This may take some time.
gpg: Generating pacman keyring master key...
gpg: [don't know]: invalid packet (ctb=00)
gpg: keydb_search failed: Invalid packet
gpg: [don't know]: invalid packet (ctb=00)
gpg: /etc/pacman.d/gnupg/pubring.gpg: copy to '/etc/pacman.d/gnupg/pubring.gpg.tmp' failed: Invalid packet
gpg: error writing public keyring '/etc/pacman.d/gnupg/pubring.gpg': Invalid packet
gpg: key generation failed: Invalid packet
gpg: Done
==> Updating trust database...
gpg: next trustdb check due at 2026-08-21

Why it there an invalid packet?

Let’s reset completely the gpg database:

sudo mv /etc/pacman.d/gnupg /etc/pacman.d/gnupg.bak
sudo pacman-key --init
sudo pacman-key --populate archlinux manjaro

And then you can try to update the archlinux keyring

2 Likes

Thank you. That worked. I was trying to follow the instructions at https://wiki.manjaro.org/index.php/Pacman_troubleshooting#Errors_about_Keys and kept getting an error of unrecognized archive format.

This worked perfectly and then could install the updates.

Thank you.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.