Problem importing keys

Hi, so I recently updated and now whenever I try to update or install anything from the AUR I get the following error while importing keys.

 :: PGP keys need importing:
 -> 1EDDE2CDFC025D17F6DA9EC0ADAE6AD28A8F901A, required by: sublime-merge
:: Import? [Y/n] 
:: Importing keys with gpg...
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
 -> problem importing keys

Any help is appreciated thanks!

My general policy is to purge any issues and get my system fully updated first.

Which tools are you using to manage AUR?

pamac remove sublime-merge

or

yay -Rnsuv sublime-merge

After clearing the errors, maybe try again to install sublime-merge.

Add AUR search to Firefox… looking at the AUR page, we see gpg errors come up now and then:

AUR Search

sajmonella9 commented on 2021-06-30 13:30 (UTC) (edited on 2021-06-30 13:31 (UTC) by sajmonella9)
Use this :

curl -SsL https://download.sublimetext.com/sublimehq-pub.gpg | gpg --import -

Note : there is something wrong with GPG servers in last weeks, idk for sure.

Installing:

pamac install sublime-merge
Failed to read AUR data from /var/lib/pacman/sync/packages-meta-ext-v1.json.gz : Error opening file /var/lib/pacman/sync/packages-meta-ext-v1.json.gz: No such file or directory
Error: target not found: sublime-merge

Dammit. I remember in the past an issue with this - not sure if it’s still relevant and lazy to fix…

Arch previously blocked Manjaro users from accessing http://aur.archlinux.org/packages-meta-ext-v1.json.gz via Pamac

  • Try another tack:
yay -S sublime-merge

I get the keys:

:: PGP keys need importing:
 -> 1EDDE2CDFC025D17F6DA9EC0ADAE6AD28A8F901A, required by: sublime-merge
:: Import? [Y/n] y
:: Importing keys with gpg...
gpg: key ADAE6AD28A8F901A: public key "Sublime HQ Pty Ltd <support@sublimetext.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1
==> Making package: sublime-merge 2102-1 (Mon 27 Jan 2025 08:40:10 +07)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found sublime_merge_build_2102_x64.tar.xz
  -> Found sublime_merge_build_2102_x64.tar.xz.asc
  -> Found LICENSE
==> Validating source files with b2sums...
    sublime_merge_build_2102_x64.tar.xz ... Passed
    sublime_merge_build_2102_x64.tar.xz.asc ... Skipped
    LICENSE ... Passed
==> Verifying source file signatures with gpg...
    sublime_merge_build_2102_x64.tar.xz ... Passed
==> Removing existing $srcdir/ directory...
==> Extracting sources...
  -> Extracting sublime_merge_build_2102_x64.tar.xz with bsdtar
==> Sources are ready.
==> Making package: sublime-merge 2102-1 (Mon 27 Jan 2025 08:40:12 +07)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> WARNING: Using existing $srcdir/ tree
==> Entering fakeroot environment...
==> Starting package()...
==> Tidying install...
  -> Removing libtool files...
  -> Purging unwanted files...
  -> Removing static library files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "sublime-merge"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: sublime-merge 2102-1 (Mon 27 Jan 2025 08:40:14 +07)
==> Cleaning up...
loading packages...
resolving dependencies...
looking for conflicting packages...

Package (1)    New Version  Net Change

sublime-merge  2102-1        23.83 MiB

Total Installed Size:  23.83 MiB

:: Proceed with installation? [Y/n] 
2 Likes

Even when trying to manually import the key I still get the same error.

$ curl -SsL https://download.sublimetext.com/sublimehq-pub.gpg | gpg --import -
gpg: keydb_get_keyblock failed: Value not found
gpg: error writing keyring '[keyboxd]': SQL library used incorrectly
gpg: error reading '-': SQL library used incorrectly
gpg: import from '-' failed: SQL library used incorrectly
gpg: Total number processed: 0
1 Like
curl -SsL https://download.sublimetext.com/sublimehq-pub.gpg | gpg --import -
gpg: key ADAE6AD28A8F901A: "Sublime HQ Pty Ltd <support@sublimetext.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

Something is messed up with your Arch Keyring, I’m not quite sure what to do here…

systemctl --user status keyboxd
â—Ź keyboxd.service - GnuPG public key management service
     Loaded: loaded (/usr/lib/systemd/user/keyboxd.service; static)
     Active: active (running) since Sun 2025-01-26 17:53:39 +07; 1 day 21h ago
 Invocation: b531374658584171872bb4fd9da5a2f6
TriggeredBy: â—Ź keyboxd.socket
   Main PID: 2605 (keyboxd)
      Tasks: 1 (limit: 18272)
     Memory: 856K (peak: 2.2M, swap: 264K, swap peak: 424K)
        CPU: 927ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/keyboxd.service
             └─2605 /usr/lib/gnupg/keyboxd --supervised

Jan 26 17:53:39 SteelLegend systemd[1770]: Started GnuPG public key management service.
Jan 26 17:53:39 SteelLegend keyboxd[2605]: keyboxd (GnuPG) 2.4.7 starting in supervised mode.
Jan 26 17:53:39 SteelLegend keyboxd[2605]: database version: 1
Jan 26 17:53:39 SteelLegend keyboxd[2605]: database created: 2024-03-23 14:13:31
Jan 26 17:53:39 SteelLegend keyboxd[2605]: database '/home/ben/.gnupg/public-keys.d/pubring.db' created

Maybe recreate keyring?

mv /etc/pacman.d/gnupg /etc/pacman.d/gnupg2
  • From ArchWiki:

Remove or reset all the keys installed in your system by removing the /etc/pacman.d/gnupg directory (as root) and by rerunning pacman-key --init followed by pacman-key --populate to re-add the default keys.

1 Like

This involves the user’s personal keyring, not the pacman keyring.

If the keyring has become corrupted, perhaps they can restore it from a backup, or maybe check if the automatically made backup (~/.gnupg/pubring.kbx~) is usable.

Hey so running this I get

â—Ź keyboxd.service - GnuPG public key management service
     Loaded: loaded (/usr/lib/systemd/user/keyboxd.service; static)
     Active: active (running) since Mon 2025-01-27 19:30:01 PST; 15h ago
 Invocation: 9713aa62e50e49d48aac2d99aaf0ddf1
TriggeredBy: â—Ź keyboxd.socket
   Main PID: 3044 (keyboxd)
      Tasks: 1 (limit: 18820)
     Memory: 656K (peak: 1.6M)
        CPU: 462ms
     CGroup: /user.slice/user-1000.slice/user@1000.service/app.slice/keyboxd.service
             └─3044 /usr/lib/gnupg/keyboxd --supervised

Jan 28 11:15:51 laptop keyboxd[3044]: cannot read lockfile
Jan 28 11:15:51 laptop keyboxd[3044]: can't lock '/home/user/.gnupg/public-keys.d/pubring.db': Invalid argument
Jan 28 11:15:51 laptop keyboxd[3044]: error creating database '/home/user/.gnupg/public-keys.d/pubring.db': Invalid argument
Jan 28 11:15:51 laptop keyboxd[3044]: error during the initial search reset: Invalid argument
Jan 28 11:15:53 laptop keyboxd[3044]: invalid size of lockfile '/home/user/.gnupg/public-keys.d/pubring.db.lock'
Jan 28 11:15:53 laptop keyboxd[3044]: cannot read lockfile
Jan 28 11:15:53 laptop keyboxd[3044]: can't lock '/home/user/.gnupg/public-keys.d/pubring.db': Invalid argument
Jan 28 11:15:53 laptop keyboxd[3044]: error creating database '/home/user/.gnupg/public-keys.d/pubring.db': Invalid argument
Jan 28 11:15:53 laptop keyboxd[3044]: error during the initial search reset: Invalid argument
Jan 28 11:15:53 laptop keyboxd[3044]: error preparing SQL statement: bad parameter or other API misuse

Checking ls -l ~/.gnupg/public-keys.d I see,

total 76
-rw-r--r-- 1 user user 73728 Nov 13 01:49 pubring.db
-rw-r--r-- 2 user user     0 Jan  8 12:34 pubring.db.lock

Since the error seems to be related to the lockfile is there any way to reset it? Should I delete it and see if that solves the issue?

Hi, so I created a backup of the lock file and database and then deleted the lock file. That seems to have solved the issue!

cp pubring.db pubring.db.bak
mv pubring.db.lock pubring.db.lock.bak

Thanks @Ben for the hint to check the status of keyboxd.

1 Like

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