# Cannot update due to key errors

**URL:** <https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286>\
**Category:** Pacman & AUR helpers\
**Created:** [February 14, 2023, 3:59pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286 "2023-02-14T15:59:17Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![points](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@points](https://forum.endeavouros.com/u/points)\
**Post date:** [February 14, 2023, 3:59pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/1 "2023-02-14T15:59:17Z")

</div>

Hi,  
I’m wondering if anyone could help.  
When running sudo pacman -Syu I get a bunch of these errors:

> :: Import PGP key 9D4C5AA15426DA0A, “Frederik Schwan [freswa@archlinux.org](mailto:freswa@archlinux.org)”? [Y/n] y  
> error: key “9D4C5AA15426DA0A” could not be looked up remotely

and then the update fails.

I have tried running the following commands to solve the problem:

> sudo pacman -Sy archlinux-keyring && pacman -Su

Returns error:

> error: archlinux-keyring: signature from “Christian Hesse [eworm@archlinux.org](mailto:eworm@archlinux.org)” is unknown trust  
> :: File /var/cache/pacman/pkg/archlinux-keyring-20230130-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).  
> Do you want to delete it? [Y/n] y  
> error: failed to commit transaction (invalid or corrupted package (PGP signature))  
> Errors occurred, no packages were upgraded.

Also tried with:

> sudo pacman-key --refresh-keys

Which generates to many errors to paste all here but here is a sample:

> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keyring\_get\_keyblock failed: Invalid keyring  
> gpg: failed to rebuild keyring cache: Invalid keyring  
> gpg: marginals needed: 3 completes needed: 1 trust model: pgp  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keydb\_get\_keyblock failed: Invalid keyring  
> gpg: validate\_key\_list failed  
> gpg: error retrieving ‘farseerfc@archlinuxcn.org’ via WKD: No data  
> gpg: error reading key: No data  
> gpg: checking the trustdb  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet

Does anyone have any idea what could be wrong? I have edited my mirrorlist to activate more mirrors, this didn’t help either.

Any help would be greatly appreciated!

---

<div class="post-metadata">

**Author:** ![pebcak](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/pebcak/32/100472_2.png) [@pebcak](https://forum.endeavouros.com/u/pebcak)\
**Post date:** [February 14, 2023, 4:35pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/2 "2023-02-14T16:35:06Z")

</div>

Have a look at:

> [@\[FAQ\] Issues with “signature is marginal trust”, "signature is unknown trust", or “invalid or corrupted package”](https://forum.endeavouros.com/t/faq-issues-with-signature-is-marginal-trust-signature-is-unknown-trust-or-invalid-or-corrupted-package/6756):
>
> If you’re getting an error similar to “Can’t update: signature from \*\*\* is marginal trust” or “invalid or corrupted package” you probably just need to update your package signing keys: sudo pacman -Sy archlinux-keyring endeavouros-keyring sudo pacman -Syu Also make sure your system clock is correct! Of course, it’s also possible that the package file actually is corrupt. Remove it from /var/cache/pacman/pkg/ so pacman will download it again. If no package file is explicitly mentioned then yo…

---

<div class="post-metadata">

**Author:** ![anon92589110](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/7ab992/32.png) [@anon92589110](https://forum.endeavouros.com/u/anon92589110)\
**Post date:** [February 14, 2023, 5:07pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/3 "2023-02-14T17:07:51Z")

</div>

You could check this: [Archlinux-keyring "invalid or corrupted"](https://forum.endeavouros.com/t/archlinux-keyring-invalid-or-corrupted/37020)

Besides that you could try and erase the cached file: /var/cache/pacman/pkg/archlinux-keyring-20230130-1-any.pkg.tar.zst

In order to get it downloaded again.

---

<div class="post-metadata">

**Author:** ![points](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@points](https://forum.endeavouros.com/u/points)\
**Post date:** [February 14, 2023, 7:19pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/4 "2023-02-14T19:19:09Z")

</div>

I have deleted the keyring file in the pacman cache, it didn’t help unfortunately.

> sudo pacman -Sy archlinux-keyring endeavouros-keyring && sudo pacman -Syu

is very similar to what I have already tried but doesn’t help, produces error:

> error: target not found: endeavouros-keyring

In the thread that was linked it was suggested to run the following commands:

> sudo pacman-key --recv-keys 497AF50C92AD2384C56E1ACA003DB8B0CB23504F

resulting in:

> ERROR: Remote key not fetched correctly from keyserver.

And/Or:

> sudo pacman-key --lsign-key 497AF50C92AD2384C56E1ACA003DB8B0CB23504F

which yields the following errors:

> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keyring\_get\_keyblock failed: Invalid keyring  
> gpg: failed to rebuild keyring cache: Invalid keyring  
> gpg: marginals needed: 3 completes needed: 1 trust model: pgp  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keydb\_get\_keyblock failed: Invalid keyring  
> gpg: validate\_key\_list failed  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keydb\_get\_keyblock failed: Invalid keyring  
> ==\> ERROR: 497AF50C92AD2384C56E1ACA003DB8B0CB23504F could not be locally signed.

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [February 14, 2023, 7:32pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/5 "2023-02-14T19:32:24Z")

</div>

> [@points](#):
>
> :: File /var/cache/pacman/pkg/archlinux-keyring-20230130-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).

You need to try to get the pkg out of cache. Try deleting it when it fails the update. Then update the mirrors again and try. If you update the mirrors maybe you need to change your mirrors. Not sure what you are using? What country you are in?

---

<div class="post-metadata">

**Author:** ![points](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@points](https://forum.endeavouros.com/u/points)\
**Post date:** [February 14, 2023, 7:42pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/6 "2023-02-14T19:42:35Z")

</div>

Running:

> sudo rm /var/cache/pacman/pkg/archlinux-keyring-20230130-1-any.pkg.tar.zst

Generates the following error:

> rm: cannot remove ‘/var/cache/pacman/pkg/archlinux-keyring-20230130-1-any.pkg.tar.zst’: No such file or directory

I have checked multiple times that the file is not present.

I have tried to uncomment every mirror in the mirrorlist file and running sudo pacman -Syu, that didn’t help either.

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [February 14, 2023, 7:57pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/7 "2023-02-14T19:57:33Z")

</div>

Okay… but then you need to download the package. If the mirrors aren’t fetching the right packager or is fetching the same package is because the mirror isn’t synced and or it can’t download it. Hence why i say change your mirror locations and update them. Pick mirrors such as US or Germany etc. that are different from what you have and update them.

---

<div class="post-metadata">

**Author:** ![points](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@points](https://forum.endeavouros.com/u/points)\
**Post date:** [February 14, 2023, 8:06pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/8 "2023-02-14T20:06:46Z")

</div>

Thank you for your help, I apologize if I’m missing something. Is there a command I should run? I have uncommented every German and US server in /etc/pacman.d/mirrorlist file.

After that I try to update (sudo pacman -Syu) and get the following errors:

> :: Proceed with installation? [Y/n] y  
> (184/184) checking keys in keyring [##########################################################################################################] 100%  
> downloading required keys…  
> :: Import PGP key 9D4C5AA15426DA0A, “Frederik Schwan [freswa@archlinux.org](mailto:freswa@archlinux.org)”? [Y/n] y  
> error: key “9D4C5AA15426DA0A” could not be looked up remotely  
> :: Import PGP key C06086337C50773E, “Jelle van der Waa [jelle@archlinux.org](mailto:jelle@archlinux.org)”? [Y/n] y  
> error: key “C06086337C50773E” could not be looked up remotely  
> :: Import PGP key 771DF6627EDF681F, “Tobias Powalowski [tpowa@archlinux.org](mailto:tpowa@archlinux.org)”? [Y/n] y  
> error: key “771DF6627EDF681F” could not be looked up remotely  
> :: Import PGP key 3B94A80E50A477C7, “Jan Alexander Steffens (heftig) [heftig@archlinux.org](mailto:heftig@archlinux.org)”? [Y/n] y  
> error: key “3B94A80E50A477C7” could not be looked up remotely  
> :: Import PGP key 76A5EF9054449A5C, “Pierre Schmitz [pierre@archlinux.org](mailto:pierre@archlinux.org)”? [Y/n] y  
> error: key “76A5EF9054449A5C” could not be looked up remotely  
> :: Import PGP key 139B09DA5BF0D338, “David Runge [dvzrv@archlinux.org](mailto:dvzrv@archlinux.org)”? [Y/n] y  
> error: key “139B09DA5BF0D338” could not be looked up remotely  
> :: Import PGP key 51E8B148A9999C34, “Evangelos Foutras [foutrelis@archlinux.org](mailto:foutrelis@archlinux.org)”? [Y/n] y  
> error: key “51E8B148A9999C34” could not be looked up remotely  
> :: Import PGP key E5BB298470AD4E41, “Sébastien Luttringer [seblu@seblu.net](mailto:seblu@seblu.net)”? [Y/n] y  
> error: key “E5BB298470AD4E41” could not be looked up remotely  
> :: Import PGP key 39E4B877E62EB915, “Sven-Hendrik Haase [svenstaro@gmail.com](mailto:svenstaro@gmail.com)”? [Y/n] y  
> error: key “39E4B877E62EB915” could not be looked up remotely  
> :: Import PGP key 786C63F330D7CB92, “Felix Yan [felixonmars@archlinux.org](mailto:felixonmars@archlinux.org)”? [Y/n] y  
> error: key “786C63F330D7CB92” could not be looked up remotely  
> :: Import PGP key 9C02FF419FECBE16, “Morten Linderud [foxboron@archlinux.org](mailto:foxboron@archlinux.org)”? [Y/n] y  
> error: key “9C02FF419FECBE16” could not be looked up remotely  
> :: Import PGP key 0F65C7D881506130, “Maxime Gauduin [alucryd@archlinux.org](mailto:alucryd@archlinux.org)”? [Y/n] y  
> error: key “0F65C7D881506130” could not be looked up remotely  
> :: Import PGP key 66E60E5F785A6824, “Campbell Jones [serebit@archlinux.org](mailto:serebit@archlinux.org)”? [Y/n] y  
> error: key “66E60E5F785A6824” could not be looked up remotely  
> :: Import PGP key 11675C743429DDEF, “Massimiliano Torromeo [mtorromeo@archlinux.org](mailto:mtorromeo@archlinux.org)”? [Y/n] y  
> error: key “11675C743429DDEF” could not be looked up remotely  
> error: required key missing from keyring  
> error: failed to commit transaction (unexpected error)  
> Errors occurred, no packages were upgraded.

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [February 14, 2023, 8:11pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/9 "2023-02-14T20:11:07Z")

</div>

Have you tried this first.

```auto
sudo pacman-key --populate archlinux endeavouros

```

```auto
sudo pacman-key --refresh-keys

```

---

<div class="post-metadata">

**Author:** ![points](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/p/e68b1a/32.png) [@points](https://forum.endeavouros.com/u/points)\
**Post date:** [February 14, 2023, 8:16pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/10 "2023-02-14T20:16:41Z")

</div>

> [@ricklinux](#):
>
> `sudo pacman-key --populate archlinux endeavouros`

Running:

```auto
sudo pacman-key --populate archlinux endeavouros

```

Generates an extreme amount of rows like this, I don’t think I can copy them all, here are the last ones:

> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keyring\_get\_keyblock failed: Invalid keyring  
> gpg: failed to rebuild keyring cache: Invalid keyring  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keydb\_get\_keyblock failed: Invalid keyring  
> gpg: validate\_key\_list failed  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keyring\_get\_keyblock failed: Invalid keyring  
> gpg: failed to rebuild keyring cache: Invalid keyring  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keyring\_get\_keyblock: read error: Invalid packet  
> gpg: keydb\_get\_keyblock failed: Invalid keyring  
> gpg: validate\_key\_list failed  
> gpg: [don’t know]: invalid packet (ctb=00)  
> gpg: keydb\_search failed: Invalid packet  
> ==\> Locally signing trusted keys in keyring…  
> ==\> ERROR: E0D16589967E1FE68EF8693E7EED78C58A63A62E could not be locally signed.  
> ==\> ERROR: 75BD80E4D834509F6E740257B1B73B02CC52A02A could not be locally signed.  
> ==\> ERROR: 2AC0A42EFB0B5CBC7A0402ED4DC95B6D7BE9892E could not be locally signed.  
> ==\> ERROR: 0F20FADC599D1C46EB556455AED8858E4B9813F1 could not be locally signed.  
> ==\> ERROR: 69E6471E3AE065297529832E6BA0F5A2037F4F41 could not be locally signed.  
> ==\> ERROR: 286E73D3CB90A2368DE1B0B12B37DD3DB00531E8 could not be locally signed.  
> ==\> ERROR: 8F43FC374CD4CEEA19CEE323E3D8752ACDF595A1 could not be locally signed.  
> ==\> ERROR: 8AD2DB862F3CA7B90B9CAF578B7B0A2203562CF6 could not be locally signed.  
> ==\> ERROR: C918B8CB65A96DFA48F1F2E6BC4423F58F260BAF could not be locally signed.

The second command also generates several pages of errors, most of them of the “Invalid packet” kind.

---

<div class="post-metadata">

**Author:** ![ricklinux](https://forum.endeavouros.com/user_avatar/forum.endeavouros.com/ricklinux/32/110798_2.png) [@ricklinux](https://forum.endeavouros.com/u/ricklinux)\
**Post date:** [February 14, 2023, 8:26pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/11 "2023-02-14T20:26:40Z")

</div>

Try

```auto
sudo pacman-key --init

```

```auto
sudo pacman-key --populate

```

---

<div class="post-metadata">

**Author:** ![anon92589110](https://forum.endeavouros.com/letter_avatar_proxy/v4/letter/a/7ab992/32.png) [@anon92589110](https://forum.endeavouros.com/u/anon92589110)\
**Post date:** [February 14, 2023, 8:57pm UTC](https://forum.endeavouros.com/t/cannot-update-due-to-key-errors/37286/12 "2023-02-14T20:57:04Z")

</div>

> [@points](#):
>
> I have checked multiple times that the file is not present

Yes, because as you posted earlier, you already deleted it.

> [@points](#):
>
> In the thread that was linked it was suggested to run the following commands:
> 
> > sudo pacman-key --recv-keys 497AF50C92AD2384C56E1ACA003DB8B0CB23504F
> 
> resulting in:
> 
> > ERROR: Remote key not fetched correctly from keyserver.

Well, I assume you just copied the exact command from the other thread, but you need to replace the key from the thread with the one you have problems with.

So, judging by your initial post it should be

> sudo pacman-key --recv-keys 9D4C5AA15426DA0A

And try the commands ricklinux postet
