Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deal with Gnupg error: gpg: no default secret key: No secret key gpg: [stdin]: clearsign failed: No secret key?

Tags:

gnupg

I am getting an error:

gpg: no default secret key: No secret key
gpg: [stdin]: clearsign failed: No secret key

My secret keys are available to GPG.

like image 233
Cindrella Avatar asked Jun 01 '12 10:06

Cindrella


2 Answers

If gpg --list-keys returns nothing, gpg --generate-key solves the problem.

like image 132
Timofey Gorshkov Avatar answered Oct 14 '22 12:10

Timofey Gorshkov


This confusing error message wasted me days of time. I deploy my maven project to maven central, which was always working, but suddenly it gives this message without prompting the passcode. Searched through all the answers didn't solve my problem. Eventually, I found out my key is expired.

gpg --list-keys

So I need to change the expiration by using gpg --edit key

And make sure to update both keys.

like image 10
Jianwu Chen Avatar answered Oct 14 '22 12:10

Jianwu Chen