gpg fails to decrypt with "public key decryption failed: Inappropriate ioctl for device"

Solution Verified - Updated -

Issue

  • GPG throws the below error after upgrading to RHEL 8:

    gpg: encrypted with 2048-bit RSA key, ID 12345678ABCDEFG, created 2020-01-01
        "Development Key <developers@email.com>"
    gpg: public key decryption failed: Inappropriate ioctl for device
    gpg: decryption failed: No secret key
    
  • After performing an upgrade from RHEL 7 to RHEL 8 GPG encryption commands are failing with Inappropriate ioctl device for device error.

  • gpg fails to decrypt on RHEL 8

Environment

  • Red Hat Enterprise Linux 8 and above
  • GnuPG

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content