6

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?

10

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.

| improve this answer | |
  • Passing the email to -k is something I didn't think of doing, thanks! – goetzc Sep 30 '18 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. – A.Danischewski Nov 25 '19 at 11:47
4

Try:

sudo debuild -b -uc -us

That command generates an unsigned deb files for local use.

| improve this answer | |
1

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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