Yubikey and gpg issues

I have Fedora 36 workstation plasma spin on my X1 Carbon. I am unable to get my yubikey 5 to be consistently recognized by gpg. It will occasionally start working after a mess around a bit and maybe reboot, but I can’t pin down a set of actions that causes this.

Any help would be greatly appreciated!


I currently get the error message:

╰─ gpg --card-status    
gpg: selecting card failed: Service is not running
gpg: OpenPGP card not available: Service is not running

I’ve tried a number of things, including:

  • installing and uninstalling opensc
  • enabling, killing/restarting, and disabling pcscd

If I look at running processes, I can see:

myuser      4328  0.0  0.0 370840   912 ?        Ssl  14:26   0:00 gpg-agent --homedir /home/myuser/.gnupg --use-standard-socket --daemon
myuser      4330  0.0  0.0 297484  1428 ?        SLl  14:26   0:00 scdaemon --multi-server

Config files:

  • ~/.gnupg/scdaemon.conf:
    pcsc-shared
    pcsc-driver libpcsclite.so.1
    
  • ~/.gnupg/gpg-agent.conf:
    pinentry-program /usr/bin/pinentry-tty
    

Sorry, I haven’t tried this myself.

I did notice a thread over at ask.fedoraproject.org that relates to using yubikey with gpg. Perhaps it contains some information that can help you: