FG
💻 Software

How to delete gpg secret keys by force, without fingerprint?

Fresh5 days ago
Mar 15, 202619081 views
Confidence Score0%
0%

Problem

It's accident generated a bulk of secret keys (without public key) in the GPG key ring, and I have written a script to delete those keys, but GPG doesn't allow me to do that: well I know what I'm doing and I know there may be duplicated key-id(s), but there seems no way to force to delete them, tho…

Error Output

$ gpg --batch --yes --delete-secret-keys KEYS
gpg: can't do this in batch mod
gpg: (unless you specify the key by fingerprint)

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
Unverified Fix
New Fix – Awaiting Verification

Fix for: How to delete gpg secret keys by force, without fingerprint?

Low Risk

Use to generate the list of fingerprints in an easily parsable format. Grab the lines of the form that correspond to the keys you want to delete, and pass the fingerprints (the ) to . The following command generates all secret key fingerprints. Be s…

Awaiting Verification

Be the first to verify this fix

Sign in to verify this fix

Environment