Arch and Manjaro Keyring issues

This is the output for

sudo pacman -S ipython
resolving dependencies...
looking for conflicting packages...

Packages (18) python-argcomplete-3.1.1-3  python-asttokens-2.4.1-2  python-decorator-5.1.1-4  python-executing-2.0.0-3  python-jedi-0.19.1-2  python-matplotlib-inline-0.1.7-1  python-parso-1:0.8.4-2
              python-pexpect-4.9.0-2  python-prompt_toolkit-3.0.45-1  python-ptyprocess-0.7.0-6  python-pure-eval-0.2.2-4  python-pygments-2.17.2-3  python-six-1.16.0-9  python-stack-data-0.6.3-2
              python-traitlets-5.14.3-2  python-typing_extensions-4.12.0-1  python-wcwidth-0.2.13-2  ipython-8.25.0-1

Total Installed Size:  37.39 MiB

:: Proceed with installation? [Y/n] 
(18/18) checking keys in keyring                                                                                         [#########################################################################] 100%
(18/18) checking package integrity                                                                                       [#########################################################################] 100%
error: python-decorator: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-decorator-5.1.1-4-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-parso: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-parso-1:0.8.4-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-jedi: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-jedi-0.19.1-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-argcomplete: signature from "Felix Yan <felixonmars@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-argcomplete-3.1.1-3-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-typing_extensions: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-typing_extensions-4.12.0-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-traitlets: signature from "Antonio Rojas <arojas@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-traitlets-5.14.3-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-matplotlib-inline: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-matplotlib-inline-0.1.7-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-ptyprocess: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-ptyprocess-0.7.0-6-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-pexpect: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-pexpect-4.9.0-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-pygments: signature from "Evangelos Foutras <foutrelis@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-pygments-2.17.2-3-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-wcwidth: signature from "Caleb Maclennan <alerque@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-wcwidth-0.2.13-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-prompt_toolkit: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-prompt_toolkit-3.0.45-1-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-six: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-six-1.16.0-9-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-asttokens: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-asttokens-2.4.1-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-executing: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-executing-2.0.0-3-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-pure-eval: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-pure-eval-0.2.2-4-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: python-stack-data: signature from "Jelle van der Waa <jelle@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/python-stack-data-0.6.3-2-any.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: ipython: signature from "Daniel M. Capella <polyzen@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/ipython-8.25.0-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.

i tried various methods to fix my keyring issues but all have failed

sudo pacman -Scc
sudo rm -f /etc/pacman.d/gnupg/*
sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
sudo pacman-key --init
sudo pacman-key --populate archlinux manjaro
sudo pacman-key --refresh-keys
sudo pacman -Sc
sudo pacman -Syu manjaro-keyring

i tried the above multiple times

export URL="https://notabug.org/megavolt/random-scripts/raw/master/fix-gpg-pacman.sh"
bash <(curl -s "$URL") --aggressive

i tried this and this also didnt work . Please help

Try without refreshing the keys.

1 Like

I tried without refreshing.
But the problem is that it fails at

: Synchronising package databases...
 core is up to date
 extra is up to date
 multilib is up to date
warning: gnupg-2.4.5-1 is up to date -- reinstalling
warning: archlinux-keyring-20240609-1 is up to date -- reinstalling
warning: manjaro-keyring-20230719-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (3) archlinux-keyring-20240609-1  gnupg-2.4.5-1  manjaro-keyring-20230719-2

Total Download Size:    3.84 MiB
Total Installed Size:  11.38 MiB
Net Upgrade Size:       1.66 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 archlinux-keyring-20240609-1-any                                                           1193.9 KiB   971 KiB/s 00:01 [#########################################################################] 100%
 gnupg-2.4.5-1-x86_64                                                                          2.7 MiB  1352 KiB/s 00:02 [#########################################################################] 100%
 Total (2/2)                                                                                   3.8 MiB  1850 KiB/s 00:02 [#########################################################################] 100%
(3/3) checking keys in keyring                                                                                           [#########################################################################] 100%
warning: Public keyring not found; have you run 'pacman-key --init'?
downloading required keys...
error: keyring is not writable
error: keyring is not writable
error: keyring is not writable
error: required key missing from keyring
error: failed to commit transaction (unexpected error)
Errors occurred, no packages were upgraded.

if i try the same thing after pacman-key --init i get this

:: Synchronising package databases...
 core is up to date
 extra is up to date
 multilib is up to date
warning: gnupg-2.4.5-1 is up to date -- reinstalling
warning: archlinux-keyring-20240609-1 is up to date -- reinstalling
warning: manjaro-keyring-20230719-2 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (3) archlinux-keyring-20240609-1  gnupg-2.4.5-1  manjaro-keyring-20230719-2

Total Installed Size:  11.38 MiB
Net Upgrade Size:       1.66 MiB

:: Proceed with installation? [Y/n] 
(3/3) checking keys in keyring                                                                                           [#########################################################################] 100%
downloading required keys...
:: Import PGP key 9B7A287D9A2EC608, "David Runge <dvzrv@archlinux.org>"? [Y/n] y
:: Import PGP key 6D42BDD116E0068F, "Christian Hesse <eworm@archlinux.org>"? [Y/n] y
(3/3) checking package integrity                                                                                         [#########################################################################] 100%
error: gnupg: signature from "David Runge <dvzrv@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/gnupg-2.4.5-1-x86_64.pkg.tar.zst is corrupted (invalid or corrupted package (PGP signature)).
Do you want to delete it? [Y/n] y
error: archlinux-keyring: signature from "Christian Hesse <eworm@archlinux.org>" is unknown trust
:: File /var/cache/pacman/pkg/archlinux-keyring-20240609-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)
Errors occurred, no packages were upgraded.

I tried many things and im not sure what to do

Can you try the steps from the script one by one?

sudo find /etc/pacman.d/gnupg/ -exec rm --recursive --force --verbose "{}" \;
echo 'Server = https://mirrors.manjaro.org/repo/stable/$repo/$arch' | tee /etc/pacman.d/mirrorlist
sudo pacman-key --init
sudo pacman --sync --clean --clean --noconfirm
sudo find /var/cache/pacman/pkg/ -type f -exec rm --force --verbose "{}" \;
sudo cp "/etc/pacman.conf" "/tmp/pacman.conf"
sudo sed --in-place --regexp-extended 's/^(SigLevel).+$/\1 = Never/g' "/tmp/pacman.conf"
sudo pacman --sync --refresh --downloadonly --noconfirm --cachedir /tmp --config "/tmp/pacman.conf" archlinux-keyring manjaro-keyring gnupg pacman-mirrors --overwrite "*"
sudo pacman --upgrade --noconfirm --config "/tmp/pacman.conf" $(find /tmp -type f -name "*.tar.*")

All the steps in the script work, execpt for the last one

loading packages...
warning: archlinux-keyring-20240609-1 is up to date -- reinstalling
warning: gnupg-2.4.5-1 is up to date -- reinstalling
resolving dependencies...
looking for conflicting packages...

Packages (4) archlinux-keyring-20240609-1  gnupg-2.4.5-1  manjaro-keyring-20230719-3  pacman-mirrors-4.26.1-1

Total Installed Size:  12.23 MiB
Net Upgrade Size:       1.67 MiB

:: Proceed with installation? [Y/n] 
(4/4) checking keys in keyring                                                                                           [#########################################################################] 100%
(4/4) checking package integrity                                                                                         [#########################################################################] 100%
(4/4) loading package files                                                                                              [#########################################################################] 100%
(4/4) checking for file conflicts                                                                                        [#########################################################################] 100%
error: failed to commit transaction (conflicting files)
archlinux-keyring: /usr/bin/archlinux-keyring-wkd-sync exists in filesystem
archlinux-keyring: /usr/lib/systemd/system/archlinux-keyring-wkd-sync.service exists in filesystem
archlinux-keyring: /usr/lib/systemd/system/archlinux-keyring-wkd-sync.timer exists in filesystem
archlinux-keyring: /usr/lib/systemd/system/timers.target.wants/archlinux-keyring-wkd-sync.timer exists in filesystem
archlinux-keyring: /usr/share/pacman/keyrings/archlinux-revoked exists in filesystem
archlinux-keyring: /usr/share/pacman/keyrings/archlinux-trusted exists in filesystem
archlinux-keyring: /usr/share/pacman/keyrings/archlinux.gpg exists in filesystem
Errors occurred, no packages were upgraded.