9

I have ubuntu 20.04 machine and installed gpg and related tools using below commad

sudo apt install gpg gnupg gnupg-pkcs11-scd

But when i run gpg --card-status, I get below error

gpg: selecting card failed: No such device
gpg: OpenPGP card not available: No such device

Should I install anything else for this ?

2 Answers 2

8

Try forcing a restart of the gpg-agent with pkill gpg-agent

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

➜ pkill gpg-agent

➜ gpg --card-status
Reader ...........: Yubico YubiKey OTP FIDO CCID
...
1
  • For me pkill gpg-agent did not work, but gpgconf --kill gpg-agent restarted the agent well and the yubikey start to work as expected.
    – Tharok
    Commented Jun 17 at 14:20
7

It seems like pcscd.service is inactive by default, have you tried (re)starting it?

sudo service pcscd restart
2
  • 1
    in my case restarting gpg-agent didn't help and pcscd service was running. Only after restarting pcscd service I was able to read the key. I'm on Fedora 38, GPG v2.4.0, pcsc-lite v1.9.9
    – Dawid
    Commented Jul 28, 2023 at 20:34
  • Fedora 39, GPG v2.4.4, pcsc-lite v2.0.1 also requires pcscd restart after each hotplug of YubiKey.
    – myroslav
    Commented Mar 5 at 21:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.