I have the following gpg key:

pub   2048R/F516F2E7 2017-06-19
uid                  Ulad Kasach <email@provider.com>
sub   2048R/4057A05F 2017-06-19

When I attempt to create and sign a package with dpkg-buildpackage -kF516F2E7 -S -sa, I get the following error:

gpg: skipped "F516F2E7": No secret key
gpg: dpkg-sign.1F6Q4CLd/<package name>.dsc: clearsign failed: No secret key

dpkg-buildpackage: error: failed to sign .dsc and .changes file

However, if I run debsign -k F516F2E7 <package name>.dsc It succeeds.

Does anyone know why this could be and how dpkg-buildpackage can be made to succeed?

3 Answers 3


I was having this same issue until now.

dpkg-buildpackage seems to expect you to pass an email address along with the -k flag rather than the key ID.

dpkg-buildpackage -kmyemail@mydomain.com

After this i had no errors.

  • 1
    Passing the email to -k is something I didn't think of doing, thanks!
    – goetz
    Sep 30, 2018 at 0:16
  • This worked for me, I tried signing it separately to no avail. An strace revealed that it was looking for the buildinfo in a temp directory.
    – Adam D.
    Nov 25, 2019 at 11:47


sudo debuild -b -uc -us

That command generates an unsigned deb files for local use.


While this does not answer the question of "why dpkg-buildpackage fails", by replacing dpkg-buildpackage with debuild (debuild accepts dpkg-buildpackage arguments) the intended result can be had.

tl;dr: "str.replace" dpkg-buildpackage with debuild for a quick solution


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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