Cannot update system after I deleted a key with pacman-key

About a month ago, every time sudo pacman -Syu failed. When I ran pacman -D -k, an error message appeared about soulharsh key being invalid. I need to run

sudo pacman -Sy archlinux-keyring
sudo pacman-key --refresh-keys

before sudo pacman -Syu would succeed. But the “refresh-keys” remedy is only temporary. Each time I tried to update the system, the invalid “soulharsh” issue reappeared and I had to refresh the keys before I could update the system.

I got fed up with this situation and decided to do something about “soulharsh”. I ran sudo pacman-key --delete <key>. Most likely I chose the wrong thing for <key> because now, I cannot update my system even after refreshing the keys. Now, I see this everytime:

$ sudo pacman -Syu
error: Reborn-OS: key "38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F" is unknown
:: Import PGP key 38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F? [Y/n] Y
error: key "38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F" could not be looked up remotely
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
 multilib is up to date
 Reborn-OS             106.7 KiB   271 KiB/s 00:00 [######################] 100%
error: Reborn-OS: key "38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F" is unknown
:: Import PGP key 38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F? [Y/n] Y
error: key "38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F" could not be looked up remotely
error: failed to synchronize all databases (invalid or corrupted database (PGP signature))

I get the same error message when I run sudo pacman -Sy archlinux-keyring

I appreciate any assistance since I have not be able to update my system for more than 2 weeks.

Hello,

A simple fix for this would be to import the key and locally sign it, you can do this by using the following commands:

sudo pacman-key --recv-keys 38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F

sudo pacman-key --lsign-key 38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F

and then, finally update your system using:

sudo pacman -Syyuv

PS: note the double ‘y’, it would also forcefully refresh / download the database files

To rule out the possibility of our old outdated mirrors serving an old outdated keyring, could you determine which of the mirrors are from OSDN and remove them?

cat /etc/pacman.d/reborn-mirrorlist | grep -i osdn

Then edit the file to remove all those lines:

sudo nano /etc/pacman.d/reborn-mirrorlist

Save using Ctrl X

Then you can try an upgrade normally

sudo pacman -Syyuv

I got the following error on the first command

$ sudo pacman-key --recv-keys 38D3F838D6A0A3AB32DDDF2299EABCFB664B3E5F
gpg: keyserver receive failed: Server indicated a failure
==> ERROR: Remote key not fetched correctly from keyserver.

No joy after removing all osdn-related lines from /etc/pacman.d/reborn-mirrorlist.

@lilaboc

sudo pacman-key --init

sudo pacman-key --populate rebornos archlinux

sudo pacman -U https://ny-mirror.soulharsh007.rocks/RebornOS/rebornos-keyring.pkg.tar.zst

@shivanandvp . I suppose after removing all lines relating to osdn from /etc/pacman.d/reborn-mirrorlist, I need to re-initialize and populate the keyring. Your instructions work. I got my system back. Thank you very much.

1 Like

Glad to know it is fixed :slightly_smiling_face: