Home Arch Linux How To Solve “error: required key missing from keyring” In Arch Linux, EndeavourOS, Manjaro Linux

How To Solve “error: required key missing from keyring” In Arch Linux, EndeavourOS, Manjaro Linux

By sk
Published: Updated: 13.2K views

Today, I deployed a new Arch Linux Container in my Proxmox VE server. When I tried to update the Arch Linux container using "pacman -Syyu" command, I encountered with this error - "error: keyring is not writable. error: required key missing from keyring".

Here is the complete output:

[root@archlinuxct ~]# pacman -Syyu
:: Synchronizing package databases...
 core                                                                155.6 KiB   199 KiB/s 00:01 [########################################################] 100%
 extra                                                              1742.4 KiB  3.22 MiB/s 00:01 [########################################################] 100%
 community                                                             7.3 MiB  3.40 MiB/s 00:02 [########################################################] 100%
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (69) acl-2.3.1-3  archlinux-keyring-20230225-1  audit-3.0.9-2  bash-5.1.016-3  brotli-1.0.9-10  bzip2-1.0.8-5  ca-certificates-mozilla-3.88.1-1
              cryptsetup-2.6.1-1  curl-7.88.1-3  dbus-1.14.6-1  device-mapper-2.03.19-1  e2fsprogs-1.47.0-1  file-5.44-3  filesystem-2023.01.31-1
              findutils-4.9.0-2  gawk-5.2.1-1  gcc-libs-12.2.1-2  glib2-2.74.5-1  glibc-2.37-2  gnutls-3.8.0-1  gpgme-1.18.0-2  grep-3.8-3  gzip-1.12-2
              hwdata-0.367-1  iana-etc-20230105-1  icu-72.1-2  iproute2-6.2.0-2  iptables-1:1.8.9-1  iputils-20221126-1  krb5-1.20.1-1  less-1:608-2
              libarchive-3.6.2-2  libcap-2.67-1  libedit-20210910_3.1-2  libelf-0.188-3  libgcrypt-1.10.1-2  libgpg-error-1.46-2  libksba-1.6.3-1
              libldap-2.6.4-1  libnftnl-1.2.4-1  libnghttp2-1.52.0-1  libnl-3.7.0-3  libpcap-1.10.3-1  libpsl-0.21.2-1  libsasl-2.1.28-4
              libsysprof-capture-3.46.0-4  libtirpc-1.3.3-2  libxcrypt-4.4.33-1  linux-api-headers-6.1.9-1  mpfr-4.2.0-3  nano-7.2-1  ncurses-6.4-1
              openssh-9.2p1-1  openssl-3.0.8-1  pacman-mirrorlist-20230226-1  pciutils-3.9.0-2  pcre2-10.42-2  psmisc-23.6-1  readline-8.2.001-2  sed-4.9-2
              shadow-4.13-2  sqlite-3.41.0-1  systemd-253-1  systemd-libs-253-1  systemd-sysvcompat-253-1  tzdata-2022g-2  xz-5.4.1-1  zlib-1:1.2.13-2
              zstd-1.5.4-1

Total Installed Size:  415.55 MiB
Net Upgrade Size:        2.57 MiB

:: Proceed with installation? [Y/n] y
(69/69) 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: keyring is not writable
error: keyring is not writable
error: keyring is not writable
error: keyring is not writable
error: keyring is not writable
error: keyring is not writable
error: keyring is not writable
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.
[root@archlinuxct ~]# 
Solve - error: required key missing from keyring in Arch Linux
Solve - error: required key missing from keyring in Arch Linux

I tried to install archlinux-keyring package to solve the issue:

# pacman -S archlinux-keyring

But, no luck! I encountered with the same error. After a couple Google searches, I fixed the "error: required key missing from keyring" issue as shown below.

Solve "error: required key missing from keyring" in Arch Linux

Run the following commands as root user to fix "error: required key missing from keyring" in Arch Linux and its variants like EndeavourOS and Manjaro Linux.

First, remove or reset all the keys installed in your system by removing the /etc/pacman.d/gnupg directory as root user:

# rm -r /etc/pacman.d/gnupg/

Next, run pacman-key --init followed by pacman-key --populate command to initialize the pacman keyring and re-add the default keys.

# pacman-key --init
# pacman-key --populate archlinux
# pacman-key --populate archlinux32

Please note that if you don't use 32 bit system, you can skip the "pacman-key --populate archlinux32" command.

Next, run the following command to manually update the keys.

# pacman-key --refresh-keys

While doing --refresh-keys, your local key will also be looked up on the remote keyserver, and you will receive a message about it not being found. This is nothing to be concerned about. This will take several minutes to complete, so please be patient!

And then clean the package cache using command:

# pacman -Sc

Finally, update the software repository list and upgrade your Arch Linux by running the following command:

# pacman -Syyu

Now you will be able to upgrade your Arch Linux system without any issues. Hope this helps.

Reference Link:

You May Also Like

1 comment

hughsheehy April 1, 2023 - 8:39 pm

This worked! i tried multiple other guides and went around in circles. This worked.

Reply

Leave a Comment

* By using this form you agree with the storage and handling of your data by this website.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. By using this site, we will assume that you're OK with it. Accept Read More